listDataElementAccess: Accesses list elements with an expression

View source: R/helpers.R

listDataElementAccessR Documentation

Accesses list elements with an expression

Description

This is the generic behind ' to modify the behaviour of '

Usage

listDataElementAccess(X, .body, .env)

Arguments

X

the list on which to operate

.body

an expression, which is either a single name, in which case a the correponding '$'-operator is applied to the list, or a full expression, in which '.' takes the role of the selected element.

.env

the environment the .body expression shall be evaluated in

Value

a list from the results of body evaluated in .env, with . standing in for the elements of X, or if .body is a name with .$name evaluted.

Examples

L = list(list(name = "a", val = 1), list(name = "b", val = 2))
# a bare name applies the corresponding `$` accessor to each element
listDataElementAccess(L, quote(name), environment())
# a full expression uses `.` for each list element
listDataElementAccess(L, quote(.$val * 10), environment())


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.