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 |
Loading required package: sp
[1] NA 2 3 4 5 6 7 8 9 10 11 NA
[1] NA NA 2 3 4 5 6 7 8 9 10 11
[1] 2 3 4 5 6 7 8 9 10 11 NA NA
[1] 5 2 3 4 5 6 7 8 9 10 11 8
[1] NA NA 1.8 2.4 2.8 3.2 3.4 3.6 4.0 4.4 4.8 5.4 6.0 6.6 7.4 NA NA NA
[1] 1.00 1.50 1.80 2.40 2.80 3.20 3.40 3.60 4.00 4.40 4.80 5.40 6.00 6.60 7.40
[16] 7.75 8.00 8.50
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.