I have five R scripts in a folder, and I would like to run all these R scripts in parallel, controlling the number of cores available.
What do you suggest to do? I tried to use "foreach" package in this way but it didn't work.
files<-list.files(pattern=".R")
foreach(x=files) %dopar% {
source(x)
}