cumapply_byname: Apply a function cumulatively to a list of matrices or numbers
Description
FUN must be a binary function that also accepts a single argument.
The result is a list with first element FUN(a[[1]]).
For i >= 2, elements are FUN(a[[i]], out[[i-1]]),
where out is the result list.
Usage
cumapply_byname(FUN, a)
Value
a list of same length as a
containing the cumulative application of FUN to a
Arguments
FUN
the function to be applied
a
the list of matrices or numbers to which FUN will be applied cumulatively
Details
naryapply_byname() and cumapply_byname() are similar.
Their differences can be described by considering a data frame.
naryapply_byname() applies FUN to several columns (variables) of the data frame.
For example, sum_byname() applied to several variables gives another column
containing the sums across each row of the data frame.
cumapply_byname() applies FUN to successive entries in a single column.
For example sum_byname() applied to a single column gives the sum of all numbers in that column.