powered by
Multicore lapply in the background
bg_mclapply(X, FUN, mc.cores = 1, ..., .wait = TRUE, .seed = NULL)
A list of output data.
A list.
The function to be applied to each element of X.
X
Passed to parallel::mclapply().
parallel::mclapply()
Arguments passed to FUN.
FUN
If FALSE, the function returns immediately; if TRUE, then wait until the background job is finished.
FALSE
TRUE
A numeric value used to set the seed for the simulation; this is the only way to control the random number generation for your simulation.
numeric
ans <- bg_mclapply(seq(10), sqrt, mc.cores = 2)
Run the code above in your browser using DataLab