View source: R/zoo_smooth_window.R
zoo_smooth_window | R Documentation |
Just a fancy wrapper for zoo::rollapply()
.
zoo_smooth_window(x = NULL, window = 3, f = mean, ...)
x |
(required, zoo object) Time series to smooth Default: NULL |
window |
(optional, integer) Smoothing window width, in number of cases. Default: 3 |
f |
(optional, quoted or unquoted function name) Name of a standard or custom function to aggregate numeric vectors. Typical examples are |
... |
(optional, additional arguments) additional arguments to |
zoo object
Other zoo_functions:
zoo_aggregate()
,
zoo_name_clean()
,
zoo_name_get()
,
zoo_name_set()
,
zoo_permute()
,
zoo_plot()
,
zoo_resample()
,
zoo_smooth_exponential()
,
zoo_time()
,
zoo_to_tsl()
,
zoo_vector_to_matrix()
x <- zoo_simulate()
x_smooth <- zoo_smooth_window(
x = x,
window = 5,
f = mean
)
if(interactive()){
zoo_plot(x)
zoo_plot(x_smooth)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.