it <- iRNGStream(313)
print(nextElem(it))
print(nextElem(it))
## Not run:
# library(foreach)
# foreach(1:3, rseed=iRNGSubStream(1970), .combine='c') %dopar% {
# RNGkind("L'Ecuyer-CMRG") # would be better to initialize workers only once
# assign('.Random.seed', rseed, pos=.GlobalEnv)
# runif(1)
# }
# ## End(Not run)
Run the code above in your browser using DataLab