I have a function bar_SE
which want to run 100 times.
bar_SE=function(i,bootstr){
out_6k <- list()
iter_max <- bootstr
z <- 0
while(z < iter_max) {
z <- z + 1
set.seed(z + 123)
out_6k[[z]] <- sample(i, length(i),replace = TRUE)
}
return(out_6k)
}
i=list(c(34:41),c(59:75))
out_all=parallel::mcmapply(function(i,bootstr){
return(bar_SE(i,bootstr))
}, i=i,bootstr=100,mc.cores=1,SIMPLIFY = FALSE)
This code works well but time consuming.
Is there any way I could run parallely in my winodw having 8 nodes.
May be an alterantive to
out_all=parallel::mcmapply(function(i,bootstr){
return(bar_SE(i,bootstr))
}, i=i,bootstr=100,mc.cores=1,SIMPLIFY = FALSE)
So, that I could faster while executing it. For instace, how to enable running mc.cores= >1 [which is not supported].