cumapply_byname | R Documentation |
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.
cumapply_byname(FUN, a)
FUN |
the function to be applied |
a |
the list of matrices or numbers to which |
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.
a list of same length as a
containing the cumulative application of FUN
to a
cumapply_byname(sum, list(1, 2, 3, 4))
cumapply_byname(sum_byname, list(1, 2, 3, 4))
cumapply_byname(prod, list(1, 2, 3, 4))
cumapply_byname(hadamardproduct_byname, list(1, 2, 3, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.