RollingApply | R Documentation |
Applies a function to a centered rolling window of data.
This is a simplified version of function rollaplly
from package zoo
.
RollingApply(data, width, func, ...)
data |
Vector of observations. Required. |
width |
Integer specifying the window width (in numbers of observations). Required. |
func |
Function to be applied. Required. |
... |
Additional arguments to be passed to |
RollingApply(c(1, 2, 3, 4, 5), width = 3, func = sum)
RollingApply(c(1, 2, 3, 4, 5), width = 3, func = mean)
RollingApply(c(1, 2, 3, 4, 5), width = 3, func = sd)
RollingApply(c(1), width = 10, func = sd)
RollingApply(c(1), width = 10, func = mean)
RollingApply(c(), width = 10, func = sd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.