named_map_builder: Named map builder.

Description Usage Arguments Value See Also Examples

View source: R/namedMapBuilder.R

Description

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

Usage

1
2
3
4
5
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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. 11, 2020, 1:08 a.m.