Create a delayed assignment

Usage

delayed_assign(..., assign.env = parent.frame())
delayed_assign_(..., .dots, assign.env = parent.frame())

Arguments

...
Expressions for which delayed assignments are created.
assign.env
The environment in which to create the delayed assignments.
.dots
Expressions as lazy objects.

Description

This function creates one or more delayed assignments in a more natural way compared to delayedAssign.

Details

The "dots" argument can be named or unnamed; for unnamed arguments, names will be assigned by all_dots. For each argument, a delayed assignment with the specified name is created via delayedAssign. The delayed assignment will evaluate the argument via lazy_eval.

The function delayed_assign_ is a standard-evaluation version of the above. See the "lazyeval" vignette for details.

Examples

## Not run: # # Creates a delayed assignment "fortytwo" which takes about 7.5 million # # years to compute: # delayed_assign(fortytwo = { Sys.sleep(7.5e6 * 365 * 24 * 60 * 60); 42 }) # ## End(Not run)