compose: Compose multiple functions

Description Usage Arguments Examples

View source: R/compose.r

Description

In infix and prefix forms.

Usage

1
2
3
compose(...)

f %.% g

Arguments

...

n functions to apply in order from right to left

f, g

two functions to compose for the infix form

Examples

1
2
3
4
5
6
not_null <- `!` %.% is.null
not_null(4)
not_null(NULL)

add1 <- function(x) x + 1
compose(add1,add1)(8)

hadley/pryr documentation built on Feb. 20, 2018, 6:11 a.m.