Compose: Compose an arbitrary number of functions.

Description Usage Arguments Value Examples

View source: R/functional.R

Description

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

Usage

1

Arguments

...

the functions to be composed

Value

A composed function

Examples

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

functional documentation built on May 29, 2017, 9:21 a.m.