set_doFuture_strategy | R Documentation |
Set a doFuture execution strategy
set_doFuture_strategy(
strategy = c("sequential", "multisession", "multicore", "mixed"),
n_workers = NULL
)
strategy |
One of |
n_workers |
A positive numeric scalar or a function specifying the maximum number of parallel futures
that can be active at the same time before blocking.
If a function, it is called without arguments when the future is created and its value is used to configure the workers.
The function should return a numeric scalar.
Defaults to |
The appropriate get_doFuture_operator()
operator to use in a foreach::foreach()
loop.
The %do%
operator is returned if strategy=="sequential"
.
Otherwise, the %dopar%
operator is returned.
`%fun%` <- set_doFuture_strategy("multisession", n_workers=3)
# perform foreach::foreach loop using the %fun% operator
end_doFuture_strategy()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.