Similar but not identical to rollapply
in package zoo, with the advantage that it works on any type of data structure (vector, list, matrix, etc) instead of requiring a zoo
object.
}
{
rollApply(1:100,sum,minimum=2,window=2)
rollApply(1:100,sum,minimum=2,window=2,align='right')
}
1 |
fun |
the function to evaluate |
... |
all other arguments to be passed to fun |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.