Compose {functional} | R Documentation |
My Happy Hacking keyboard gave out during the writing of this procedure; moment of silence, please.
Compose(...)
... |
the functions to be composed |
A composed function
car <- function(list) list[[1]]
cdr <- function(list) list[2:length(list)]
cadr <- Compose(cdr, car)
stopifnot(cadr(c(1,2,3)) == 2)