Description Usage Arguments Details Value Author(s) References See Also Examples
Plots historical data with forecasts and prediction intervals.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
x |
Forecast object produced by |
include |
number of values from time series to include in plot. Default is all values. |
PI |
Logical flag indicating whether to plot prediction intervals. |
showgap |
If |
shaded |
Logical flag indicating whether prediction intervals should be
shaded ( |
shadebars |
Logical flag indicating if prediction intervals should be
plotted as shaded bars (if |
shadecols |
Colors for shaded prediction intervals. To get default
colors used prior to v3.26, set |
col |
Colour for the data line. |
fcol |
Colour for the forecast line. |
pi.col |
If |
pi.lty |
If |
ylim |
Limits on y-axis. |
main |
Main title. |
xlab |
X-axis label. |
ylab |
Y-axis label. |
type |
1-character string giving the type of plot desired. As for
|
flty |
Line type for the forecast line. |
flwd |
Line width for the forecast line. |
... |
Other plotting parameters to affect the plot. |
object |
Forecast object produced by |
series |
Matches an unidentified forecast layer with a coloured object on the plot. |
fitcol |
Line colour for fitted values. |
pch |
Plotting character (if |
autoplot
will produce a ggplot object.
plot.splineforecast autoplot.splineforecast
None.
Rob J Hyndman & Mitchell O'Hara-Wild
Hyndman and Athanasopoulos (2018) Forecasting: principles and practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/
1 2 3 4 5 6 7 8 9 | library(ggplot2)
wine.fit <- hw(wineind,h=48)
plot(wine.fit)
autoplot(wine.fit)
fit <- tslm(wineind ~ fourier(wineind,4))
fcast <- forecast(fit, newdata=data.frame(fourier(wineind,4,20)))
autoplot(fcast)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.