Description Usage Arguments Details Author(s) References See Also Examples
Plots historical data with multivariate forecasts and prediction intervals.
1 2 3 4 5 6 7 8 9 10 |
object |
Multivariate forecast object of class |
PI |
If |
facets |
If TRUE, multiple time series will be faceted. If FALSE, each series will be assigned a colour. |
colour |
If TRUE, the time series will be assigned a colour aesthetic |
... |
additional arguments to each individual |
series |
Matches an unidentified forecast layer with a coloured object on the plot. |
x |
Multivariate forecast object of class |
main |
Main title. Default is the forecast method. For autoplot, specify a vector of titles for each plot. |
xlab |
X-axis label. For autoplot, specify a vector of labels for each plot. |
autoplot
will produce an equivalent plot as a ggplot object.
Mitchell O'Hara-Wild
Hyndman and Athanasopoulos (2014) Forecasting: principles and practice, OTexts: Melbourne, Australia. http://www.otexts.org/fpp/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(ggplot2)
lungDeaths <- cbind(mdeaths, fdeaths)
fit <- tslm(lungDeaths ~ trend + season)
fcast <- forecast(fit, h=10)
plot(fcast)
autoplot(fcast)
carPower <- as.matrix(mtcars[,c("qsec","hp")])
carmpg <- mtcars[,"mpg"]
fit <- lm(carPower ~ carmpg)
fcast <- forecast(fit, newdata=data.frame(carmpg=30))
plot(fcast, xlab="Year")
autoplot(fcast, xlab=rep("Year",2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.