View source: R/sequence_characteristics.R
moving_function | R Documentation |
Apply function to (centered) moving window
moving_function(x, k = 3, win_fun = sum, na.rm = FALSE, circular = FALSE)
x |
A numeric vector. |
k |
An integer value. The width of the moving window. |
win_fun |
A function. The function must return an object of length one
and accept |
na.rm |
A logical value. Used as argument to |
circular |
A logical value. If |
A numeric vector of the length of x
.
movingFun
The package caTools
provides fast versions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.