mappers: Mappers

Description Usage Arguments Value

Description

Performs vctrs - compatibel mapping. Requries strongly typed input and output. By default returns vctrs::list_of. *_pt version performs conversion to the common ptype.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
vmap(.x, .f, ..., .ptype = NULL)

vmap_pt(.x, .f, ..., .ptype = NULL)

vmap2(.x, .y, .f, ..., .ptype = NULL)

vmap2_pt(.x, .y, .f, ..., .ptype = NULL)

vmap_if(.x, .p, .f, ..., .else = NULL, .ptype = NULL)

vmap_at(.x, .at, .f, ..., .ptype = NULL)

vkeep(.x, .p, ..., .ptype = NULL)

vdiscard(.x, .p, ..., .ptype = NULL)

vimap(.x, .f, ..., .ptype = NULL)

vimap_pt(.x, .f, ..., .ptype = NULL)

Arguments

.x, .y

Vectors to iterate over.

.f

Mapper function.

...

Additional paramters passed to mappers

.ptype

Fallback ptype for type-stability of empty collections.

.p

Predicate function.

.else

Alternative mapper for vmap_if.

.at

Location to map at.

Value

Either list_of or vector of common ptype.


Ilia-Kosenkov/primitiveR documentation built on Jan. 20, 2021, 2:13 p.m.