Description Arguments Value Usage Details Author(s) See Also Examples
Apply a function to a rolling range of a sequence and the accumulated value of the previous function applications
x |
Any indexable data structure |
window |
The length of the sub-sequence passed to fn |
fn |
The function applied to the rolling range |
acc |
An object that stores the intermediate accumulated result |
The accumulated result
foldrange(x, window, fn, acc, idx) foldrange(x, window, fn, acc, 0) foldrange(x, window, fn, acc=0, idx=length(x)-window+1)
When ! is.null(dim(x)) foldrange(x, window, fn, acc=0)
This function is the fold counterpart of maprange. It's primarily here for completeness purposes, as the utility of this function is still to be determined.
Brian Lee Yung Rowe
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.