collect: collect results

Description Usage Arguments Details Examples

View source: R/collect.R

Description

collect results

Usage

1
collect(v, fun, ...)

Arguments

v

a vector, list, array, etc.

fun

a function to collect on

...

passed to f

Details

Collect results by resursively calling the elements of the vector v. The first two elements are called as fun(v[1], v[2],...) The result is x. Then f(x, v[3]) is called and so forth, until all elements has been exhausted.

as such fun must take two arguments and return a single element, although there are no restrictions on what that single thing might be.

Examples

1
collect(v=letters, fun=function(x,y,...)paste(y,x, ...), sep='/')

dostats documentation built on May 29, 2017, 6:07 p.m.