Applies a rolling mean filter to a numeric vector using
data.table::frollmean().
Usage
filter_rollmean(
x,
window_width = 5,
min_obs = 1,
align = c("right", "left", "center")
)Details
For align = "right" or "left", partial windows at the edges of the
series are computed (so position 1 with a width-5 right-aligned window
returns the value at position 1, not NA). For align = "center",
edges are not partial: the first and last (window_width - 1) %/% 2
positions return NA. This is a limitation of the underlying
data.table::frollmean() implementation.