These options are used by
future() internally to tweak the environment that
the expressions are called in. The most important ones are
packages which allow you to be explicit about the variables and packages
that are exported to each worker.
A logical, a character vector, or a named list for
controlling how globals are handled. For details, see
(optional) a character vector specifying packages to be attached in the R environment evaluating the future.
A logical or an integer (of length one or seven),
or a list of
Specifies whether the futures should be resolved lazily or eagerly (default).
Average number of futures ("chunks") per worker.
By default, the
future package will perform black magic to look up the
global variables and packages that your
furrr call requires, and it
will export these to each worker. However, it is not always perfect, and
can be refined with the
globals may be used to control how globals
should be handled similarly how the
globals argument is used with
future(). Since all function calls use the same set of globals, this function can do
any gathering of globals upfront (once), which is more efficient than if
it would be done for each future independently.
NULL, then globals are automatically identified and gathered.
If a character vector of names is specified, then those globals are gathered.
If a named list, then those globals are used as is.
In all cases,
.f and any
... arguments are automatically
passed as globals to each future created as they are always needed.
packages may be used to control the packages that are exported
to each worker.
If a character vector of packages names is specified, those are exported to each worker.
In all cases,
purrr is exported, as it is always required on each worker.
seed = FALSE, this function guarantees to generate
the exact same sequence of random numbers given the same initial
seed / RNG state - this regardless of type of futures and scheduling
RNG reproducibility is achieved by pregenerating the random seeds for all
.x) by using L'Ecuyer-CMRG RNG streams. In each
iteration, these seeds are set before calling
Note, for large
length(.x) this may introduce a large overhead.
As input (
seed), a fixed seed (integer) may be given, either
as a full L'Ecuyer-CMRG RNG seed (vector of 1+6 integers) or as a seed
generating such a full L'Ecuyer-CMRG seed.
seed = TRUE, then
is returned if it holds a L'Ecuyer-CMRG RNG seed, otherwise one is created
seed = NA, a L'Ecuyer-CMRG RNG seed is randomly created.
If none of the function calls
.f(.x[[ii]], ...) uses random number
seed = FALSE may be used.
In addition to the above, it is possible to specify a pre-generated
sequence of RNG seeds as a list such that
length(seed) == length(.x) and where each element is an
integer seed that can be assigned to
Use this alternative with caution.
as.list(seq_along(.x)) is not a valid set of such
In all cases but
seed = FALSE, the RNG state of the calling
R processes after this function returns is guaranteed to be
"forwarded one step" from the RNG state that was before the call and
in the same way regardless of
and future strategy used. This is done in order to guarantee that an R
future_map() multiple times should be numerically
reproducible given the same initial seed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.