Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compose

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

Tools for Computing on the Language

v0.1.4
GPL-2
Authors
Hadley Wickham [aut, cre], R Core team [ctb] (Some code extracted from base R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.