Compose: Compose multiple functions.

Description Usage Arguments Details See Also Examples

Description

Returns a function that applies the last argument to its input, than the penultimate argument and so on.

Usage

1
2
3
4
5
Compose(...)

f %.% g

Sequence(...)

Arguments

...

The functions to be composed.

f, g

Two functions to compose (infix notation).

Details

Sequence is the same as Compose, except that it applies the functions in argument-list order.

See Also

Other Functionals: And, Call, Delay_by, Dot_every, FMap, Fail_with, Log_to, Maybe, Partial

Examples

1
2
3
4
5
6
 x <- c(1, 1, 2, 2, 3, 3)
 nunique <- Compose(length, unique)
 nunique(x) == length(unique(x))
 
 ## useful in lapply constructs
 sapply(mtcars, length %.% unique)

gschofl/gsmisc documentation built on May 17, 2019, 8:52 a.m.