This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/delay.html
delay {base}R Documentation

Delay Evaluation

Description

delay creates a promise to evaluate the given expression in the specifies environment if its value is requested. This provides direct access to lazy evaluation mechanism used by R for the evaluation of (interpreted) functions.

This is an experimental feature and its addition is purely for evaluation purposes.

Usage

delay(expr, env=.GlobalEnv)

Arguments

expr

an expression.

env

an evaluation environment

Value

A promise to evaluate the expression. The value which is retuned by delay can be assigned without forcing its evaluation, but any further accesses will cause evaluation.

Examples

x <- delay({
    for(i in 1:10)
        print("yippee!\n")
    10
})

[Package base version 0.60 ]