named_map_builder: Named map builder.

View source: R/namedMapBuilder.R

named_map_builderR Documentation

Named map builder.

Description

Set names of right-argument to be left-argument, and return right argument. Called from := operator.

Usage

named_map_builder(targets, values)

`:=`(targets, values)

targets %:=% values

Arguments

targets

names to set.

values

values to assign to names (and return).

Value

values with names set.

See Also

lambda, defineLambda, makeFunction_se

Examples



c('a' := '4', 'b' := '5')
# equivalent to: c(a = '4', b = '5')

c('a', 'b') := c('1', '2')
# equivalent to: c(a = '1', b = '2')

# the important example
name <- 'a'
name := '5'
# equivalent to: c('a' = '5')


wrapr documentation built on Aug. 20, 2023, 1:08 a.m.