Learn R Programming

sits (version 1.5.4)

impute_mean_window: Remove NA using weighted moving average

Description

Remove NA using weighted moving average

Usage

impute_mean_window(data = NULL, k = 2, weighting = "simple")

Value

A set of filtered time series using the imputation function.

Arguments

data

A time series vector or matrix

k

A integer width of the moving average window. Expands to both sides of the center element e.g. k = 2 means 4 observations (2 left, 2 right) are taken into account. If all observations in the current window are NA, the window size is automatically increased until there are at least 2 non-NA values present

weighting

A string with the weighting strategy to be used. More details below (default is "simple").

Author

Felipe Carlos, efelipecarlos@gmail.com

References

The implementation of this function was adapted from the imputeTS R Package. The code is open-source, under the GPL license, and is available on GitHub https://github.com/SteffenMoritz/imputeTS.