Description Usage Arguments Value Author(s) Examples

Helper function to compute 'moving' functions, such as the 'moving average'

1 |

`x` |
A vector of numbers |

`n` |
Size of the 'window', i.e. the number of sequential elements to use in the function |

`fun` |
A function like mean, min, max, sum |

`type` |
Character. One of 'around', 'to', or 'from'. The choice indicates which values should be used in the computation. The focal element is always used. If |

`circular` |
Logical. If |

`na.rm` |
Logical. If |

Numeric

Robert J. Hijmans, inspired by Diethelm Wuertz' rollFun function in the fTrading package

1 2 3 4 5 6 7 8 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.