In my thesis I need to perform a lot of simulation studies, which all takes quite a while. My computer has 4 cores, so I have been wondering if it is possible to run for exa
You can achieve multicore parallelism (as explained here https://cran.r-project.org/web/packages/doMC/vignettes/gettingstartedMC.pdf) in the same session with the following code
if(Sys.info()["sysname"]=="Windows"){
library(doParallel)
cl<-makeCluster(numberOfCores)
registerDoParallel(cl)
}else{
library(doMC)
registerDoMC(numberOfCores)
}
library(foreach)
someList<-list("file1","file2")
returnComputation <-
foreach(x=someList) %dopar%{
source(x)
}
if(Sys.info()["sysname"]=="Windows") stopCluster(cl)
You will need still adapt your output.