search for: gurbuxani

Displaying 5 results from an estimated 5 matches for "gurbuxani".

2023 Jan 27
3
implicit loop for nested list
> > I am looking for a more elegant way to write below code. > > #Simulation results have different dimensions > mysim <- lapply(1:10, function(y) { > two.mat <- matrix(rnorm(4), nrow = 2) > four.mat <- matrix(rnorm(16), nrow = 4) > list(two.mat = two.mat, four.mat = four.mat) #results with different dimensions > }) > > #Collect different
2023 Jan 27
1
implicit loop for nested list
...hould give you a matrix-list. You can slice this matrix-list just like normal, then cbind it in one step: ``` two.mat <- do.call("cbind", mysim["two.mat", ]) four.mat <- do.call("cbind", mysim["four.mat", ]) ``` On Thu, Jan 26, 2023 at 10:33 PM Naresh Gurbuxani <naresh_gurbuxani at hotmail.com> wrote: > > > > > I am looking for a more elegant way to write below code. > > > > #Simulation results have different dimensions > > mysim <- lapply(1:10, function(y) { > > two.mat <- matrix(rnorm(4), nrow = 2) &...
2023 Nov 18
1
combine barchart and xyplot in lattice
On Sat, 18 Nov 2023 at 06:44, Naresh Gurbuxani <naresh_gurbuxani at hotmail.com> wrote: > > In below graph, I would like to add two vertical lines using > panel.abline(). Is this possible? I assume you want the 'v' variable in panel.abline() to be interpreted in the context of your x-axis, which here represents a factor...
2024 May 09
2
Strange variable names in factor regression
On converting character variables to ordered factors, regression result has strange names. Is it possible to obtain same variable names with and without intercept? Thanks, Naresh mydf <- data.frame(date = seq.Date(as.Date("2024-01-01"), as.Date("2024-03-31"), by = 1)) mydf[, "wday"] <- weekdays(mydf$date, abbreviate = TRUE) mydf.work <- subset(mydf, !(wday
2023 Nov 18
1
combine barchart and xyplot in lattice
In below graph, I would like to add two vertical lines using panel.abline(). ?Is this possible? Thanks, Naresh mydf <- data.frame(hour = rep(6:20, 2), traffic = c(round(dnorm(6:20, 9, 3) * 10000), round(dnorm(6:20, 17, 4) * 10000)), direction = rep(c("inbound", "outbound"), c(15, 15))) vehicles <- data.frame(hour = 6:20, count = c(100, 120, 140, 125, 105, 80, 70, 75,