assign-active: Create an active binding.

%<a-%R Documentation

Create an active binding.

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

x %<a-% value

Arguments

x

unquoted expression naming variable to create

value

unquoted expression to evaluate every time name is accessed

Examples

x %<a-% runif(1)
x
x
x %<a-% runif(10)
x
x
rm(x)

pryr documentation built on Jan. 18, 2023, 1:08 a.m.