movingFn | R Documentation |
generic fn that computes the "fn" on a moving window
movingFn(x, fn = mean, period = length(x), direction = "forward")
x |
a numeric vector |
fn |
a function to be applied/computed, default is set to mean() |
period |
size of the "moving window", default set to the lenght of the vector |
direction |
type of moving avergage to consider: "forward", "centered", "backward"; ie. whether the window computation is ( "centered" / "forward" / "backward" ) wrt the data series |
a vector with the 'moving operation' applied to the x vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.