View source: R/moving_avg_filter.R
moving_avg_filter | R Documentation |
Filters data using moving averages of diferent window sizes.
moving_avg_filter(x, y, k)
x |
A numeric vector with the position values of the data to filter (a sequence) |
y |
A numeric vector with the data to filter |
k |
A numeric vector with the widths of the windows to use for the filter (must be an odd number) |
A list with two tibbles: one with the filtered results plus the original data, and one with the residuals
Swan, A. R. H. & Sandilands, M. (1995). Introduction to Geological Data Analysis. Blackwell Science.
data(nautilus) head(nautilus) k = c(3, 5, 11, 25) moving_avg_filter(nautilus$x, nautilus$y, k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.