Displaying 4 results from an estimated 4 matches for "naresh_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
...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)
> > four.mat...
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
variable. Unless two...
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,