fold: fold - also known variously as reduce, accumulate, compress,...

Description Usage Arguments Value Author(s) Examples

Description

http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29 shamelessly copied from this post by Hadley Wickam: https://stat.ethz.ch/pipermail/r-help/2007-April/130462.html

Usage

1
fold(x, fun)

Arguments

x

a list of vectors

fun

a function to apply recursively to x

Value

result of x fold fun.

Author(s)

Levi Waldron and Markus Riester

Examples

1
2
 a <- list(c(1,3,5), c(1,3), c(1, 2, 5, 6))
fold(a, intersect) 

lwaldron/LeviRmisc documentation built on May 21, 2019, 8:59 a.m.