I am using the following code to run simulations. How can I get a from x1? I have tried lapply below but doesn't seem to work.
library(parallel)
clusterEvalQ(cl,library(evir))
set.seed(0)
system.time(
x1 <- parLapply(cl, 1:100000,
function(i) {
n1 <- rpois(1,4)
n2<- rpois(1,7)
list(data.frame(a=rexp(n1, rate=0.1),a1=rexp(n1, rate=0.6)),
data.frame(b=rexp(n2, rate=0.7),b1=rexp(n2, rate=0.6)))
}
)
)
y1<-lapply(x1, '[', , "a")
aora1- 1) is known? Or should we look for this column across all data frames?ais not adata.frameit's avectorwithin a data.frame. The same is true ofb... You don't understand the data structures you're working with.