| Future-class | R Documentation |
A future is an abstraction for a value that may be
available at some point in the future. A future can either be
unresolved or resolved, a state which can be checked
with resolved(). As long as it is unresolved, the
value is not available. As soon as it is resolved, the value
is available via value().
Future(
expr = NULL,
envir = parent.frame(),
substitute = TRUE,
stdout = TRUE,
conditions = "condition",
globals = list(),
packages = NULL,
seed = FALSE,
lazy = FALSE,
label = NULL,
...
)
expr |
An R expression. |
envir |
The environment from where global objects should be identified. |
substitute |
If TRUE, argument |
stdout |
(evaluation) If TRUE (default), then the standard output is
captured, and re-outputted when |
conditions |
(evaluation) A character string of condition classes to
be captured and relayed. The default is to relay all conditions,
including messages and warnings. To drop all conditions, use
|
globals |
(resource; optional) a logical, a character vector, or
a named list to control how globals are handled.
For details, see section 'Globals used by future expressions'
in the help for |
packages |
(resource; optional) a character vector specifying
packages to be attached in the R environment evaluating the future,
in addition to packages required by global variables specified or
identified via argument |
seed |
(resource; optional) If TRUE, the random seed, that is, the
state of the random number generator (RNG) will be set such that
statistically sound random numbers are produced (also during
parallelization).
If FALSE (default), it is assumed that the future expression neither
needs nor uses random number generation.
To use a fixed random seed, specify a L'Ecuyer-CMRG seed (seven integers)
or a regular RNG seed (a single integer). If the latter, then a
L'Ecuyer-CMRG seed will be automatically created based on the given seed.
Furthermore, if FALSE, then the future will be monitored to make sure it
does not use random numbers. If it does and depending on the value of
option future.rng.onMisuse, the check is
ignored, an informative warning, or error will be produced.
If |
lazy |
(scheduling) If FALSE (default), the future is resolved eagerly (starting immediately), otherwise not. |
label |
A character string label attached to the future. |
... |
Additional named elements of the future. |
A Future object is itself an environment.
Future() returns an object of class Future.
One function that creates a Future is future().
It returns a Future that evaluates an R expression in the future.
An alternative approach is to use the %<-% infix
assignment operator, which creates a future from the
right-hand-side (RHS) R expression and assigns its future value
to a variable as a promise.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.