assign-active: Create an active binding.

Description Usage Arguments Examples

Description

Infix form of makeActiveBinding which creates an active binding between a name and an expression: every time the name is accessed the expression is recomputed.

Usage

1
x %<a-% value

Arguments

x

unquoted expression naming variable to create

value

unquoted expression to evaluate every time name is accessed

Examples

1
2
3
4
5
6
7
x %<a-% runif(1)
x
x
x %<a-% runif(10)
x
x
rm(x)

Example output

[1] 0.01164537
[1] 0.3577607
 [1] 0.04649371 0.42770790 0.41251429 0.77433020 0.19391345 0.72244228
 [7] 0.62696986 0.50690640 0.72230997 0.55286618
 [1] 0.05505768 0.91438923 0.74217295 0.85119160 0.85447427 0.60803823
 [7] 0.71668680 0.60628870 0.95113438 0.77673010

pryr documentation built on May 2, 2019, 9:58 a.m.