HenrikBengtsson / doFuture

:rocket: R package: doFuture - Use Foreach to Parallelize via Future Framework
https://doFuture.futureverse.org
84 stars 6 forks source link

DOCS: Examples use the RNG without declaring so #57

Closed HenrikBengtsson closed 3 years ago

HenrikBengtsson commented 3 years ago

The examples in the vignette all use the RNG without declaring so, e.g.

mu <- 1.0
sigma <- 2.0
x <- foreach(i = 1:3, .export = c("mu", "sigma")) %dopar% {
  rnorm(i, mean = mu, sd = sigma)
} 

The proper way here is to use %dorng% instead of %dopar%. However, we don't want to introduce that in the introduction, so needs another example without RNG.

Related to https://github.com/HenrikBengtsson/future.apply/issues/72