compose: Compose multiple functions

View source: R/compose.r

composeR Documentation

Compose multiple functions

Description

In infix and prefix forms.

Usage

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

not_null <- `!` %.% is.null
not_null(4)
not_null(NULL)

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

pryr documentation built on Jan. 18, 2023, 1:08 a.m.