moving_avg_filter: Moving average filter

View source: R/moving_avg_filter.R

moving_avg_filterR Documentation

Moving average filter

Description

Filters data using moving averages of diferent window sizes.

Usage

moving_avg_filter(x, y, k)

Arguments

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)

Value

A list with two tibbles: one with the filtered results plus the original data, and one with the residuals

References

Swan, A. R. H. & Sandilands, M. (1995). Introduction to Geological Data Analysis. Blackwell Science.

Examples

data(nautilus)
head(nautilus)
k = c(3, 5, 11, 25)
moving_avg_filter(nautilus$x, nautilus$y, k)


maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.