how to use lapply to get exactly same random number from mclapply

54 views Asked by At
library(parallel)
RNGkind("L'Ecuyer-CMRG")
set.seed(100)
mclapply(1:4, function(i) rnorm(1))

The above codes work well. But how can we reproduce the random number in sequential process mode?

if we replace the above mclapply with lapply, the results will be changed.

0

There are 0 answers