compose: Make composition of functions

Description Usage Arguments Details Value Examples

Description

Input functions should be ordered from innermost to outtermost. All arguments are passed to the innermost function, whose formal arguments are transferred exactly to the composed function.

Usage

1

Arguments

...

two or more functions

Details

The composed function is a member of the environment in which 'compose' was called. The composition does not copy the constituent functions, but rather searches for them in the parent frame. So, given 'foo <- compose(f,g,h)' calling ‘foo()' is exactly equivalent to calling 'h(g(f))()' in foo’s parental environment.

Value

A function that is a composition of the input functions

Examples

1
2
library(magrittr)
compose(runif, mean, abs, log)

arendsee/pied documentation built on May 10, 2019, 1:20 p.m.