R.utils (version 1.34.0)

PERCENT< -PERCENT: Assignment operator for delayed assignments

Description

Assignment operator for delayed assignments such that the expression on the right-hand side (RHS) will not be evaluated until the value of the assigned variable (on left-hand side (LHS)) is evaluated.

Usage

x %<-% value

Arguments

x
The variable name (possibly quoted).
value
The value to be assigned to x.

Value

  • Returns (invisibly) NULL. Note, contrary to <-(), it is not meaniful to do a %<-% b %<-% c %<-% 6.

See Also

Internally delayedAssign() is used.

Examples

Run this code
message("a %<-% ...")
a %<-% { message("Now assigning 'a'"); 1 }
message("b %<-% a")
b %<-% a
message("c %<-% b")
c %<-% b
message("d %<-% 2*c")
d <- 2*c

Run the code above in your browser using DataCamp Workspace