list.maps: Map multiple lists with an expression

Description Usage Arguments Examples

View source: R/list.map.R

Description

Map multiple lists with an expression

Usage

1
list.maps(expr, ...)

Arguments

expr

An implicit lambda expression where only .i and .name are defined.

...

Named arguments of lists with equal length. The names of the lists are available as symbols that represent the element for each list.

Examples

1
2
3
4
5
6
7
## Not run: 
l1 <- list(p1=list(x=1,y=2), p2=list(x=3,y=4), p3=list(x=1,y=3))
l2 <- list(2,3,5)
list.maps(a$x*b+a$y,a=l1,b=l2)
list.maps(..1$x*..2+..1$y,l1,l2)

## End(Not run)

Example output

$p1
[1] 4

$p2
[1] 13

$p3
[1] 8

$p1
[1] 4

$p2
[1] 13

$p3
[1] 8

rlist documentation built on Sept. 5, 2021, 5:30 p.m.