make_futures_: Construct futures for a list of expressions

View source: R/prog_utils.R

make_futures_R Documentation

Construct futures for a list of expressions

Description

Instead of evaluating the expressions in the list, this function constructs a future for each expression and returns the list of these futures.

Usage

make_futures_(expressions, .future.args = list())

Arguments

expressions

The list of unevaluated expressions for which to construct futures. Each element can be anything that rlang::as_quosure() will accept.

.future.args

Additional arguments to pass to future::future().

Details

This is the standard-evaluation helper for make_futures(), which uses non-standard evaluation.

Value

A list of futures, whose values will be the result of evaluating each of expressions.

See Also

rlang::eval_tidy(), rlang::quo(), rlang::as_quosure(), future::value()

Examples


library(future)
library(rlang)
expressions <- list(a = quo(1+1), b = quo(2+2))

flist <- make_futures_(expressions)
flist
value(flist)

# Same result without futures
lapply(expressions, eval_tidy)


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.