What is a promise object in R?

Promise objects are used within packages to make objects available to users without loading them into the memory. Unfortunately, it is not possible to determine if an object is a promise object, nor it is possible to figure out the environment in which it was created. For example : You can create a promise object to delay evaluation of a variable until it is (first) needed. You can do it using delayedAssign function.

 x <- 1
 y <- 2
 z <- 3
 delayedAssign("v", c(x, y, z))
 x <- 5
 v
#[1] 5 2 3

Reference : http://130.132.212.207/mediawiki/images/0/09/R_in_a_Nutshell.pdf

Tags:

R