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

Compose

Compose an arbitrary number of functions.


Description

My Happy Hacking keyboard gave out during the writing of this procedure; moment of silence, please.

Usage

Compose(...)

Arguments

...

the functions to be composed

Value

A composed function

Examples

car <- function(list) list[[1]]
cdr <- function(list) list[2:length(list)]
cadr <- Compose(cdr, car)
stopifnot(cadr(c(1,2,3)) == 2)

functional

Curry, Compose, and other higher-order functions

v0.6
GPL (>= 2)
Authors
Peter Danenberg <pcd@roxygen.org>
Initial release
2014-07-15

We don't support your browser anymore

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