View source: R/parallel_replicate.R
preplicate | R Documentation |
Implements parallel version of replicate
using
parallel::mclapply()
.
preplicate(n, expr, simplify = "array", ...)
n |
integer: the number of replications. |
expr |
the expression (a language object, usually a call) to evaluate repeatedly. |
simplify |
logical or character string, see |
... |
other arguments to be passed to |
A list, vector, or matrix depending on arguments to simplify
.
See documentation for replicate
for more details.
## Not run:
system.time(r <- replicate(10000, var(rnorm(500))))
system.time(pr <- preplicate(10000, var(rnorm(500)), mc.cores = 3))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.