Description Usage Arguments Examples
View source: R/register-parallel.R
Register parallel in functions. Do makeCluster()
, registerDoParallel()
and stopCluster()
when the function returns.
1 | register_parallel(ncores, ...)
|
ncores |
Number of cores to use. If using only one, then this function
uses |
... |
Arguments passed on to |
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
test <- function(ncores) {
register_parallel(ncores)
foreach(i = 1:2) %dopar% i
}
test(2) # only inside the function
foreach(i = 1:2) %dopar% i
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.