Description Usage Arguments Details Value Author(s) See Also Examples
Extracts and plots the trend for a time series.
1 2 3 4 5 6 7 8 |
x |
A time series |
order |
Order of moving average smoother. Defaults to 5. |
plot |
Whether to plot the trend or not. Defaults to TRUE. |
detrend |
Whether to remove the calculated trend from the time series or not. TRUE needed to use with ts_season(). Defaults to TRUE. |
detrendPlot |
Whether to plot the detrended series. Defaults to FALSE. |
type |
Type of de decomposition, either "additive" or "multiplicative". Defaults to "additive". |
The moving average smoother averages the nearest order periods of each observation.
If either plot or detrendPlot a list containing the series and the plots, otherwise a list containing the trend and the order of the moving average.
David Alberto Mateos Montes de Oca
ma()
1 2 | x <- AirPassengers
ts_trend(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.