powered by
autoplot takes an object of type ts or mts and creates a ggplot object suitable for usage with stat_forecast.
autoplot
ts
mts
stat_forecast
# S3 method for ts autoplot( object, series = NULL, xlab = "Time", ylab = deparse(substitute(object)), main = NULL, facets = FALSE, colour = TRUE, ... )# S3 method for ts fortify(model, data, ...)
# S3 method for ts fortify(model, data, ...)
Object of class “ts” or “mts”.
Identifies the time series with a colour, which integrates well with the functionality of geom_forecast.
a string with the plot's x axis label. By default a NUll value.
a string with the plot's y axis label. By default a counts" value.
a string with the plot's title.
If TRUE, multiple time series will be faceted (and unless specified, colour is set to FALSE). If FALSE, each series will be assigned a colour.
If TRUE, the time series will be assigned a colour aesthetic
Other plotting parameters to affect the plot.
Object of class “ts” to be converted to “data.frame”.
data.frame
Not used (required for fortify method)
None. Function produces a ggplot2 graph.
fortify.ts takes a ts object and converts it into a data frame (for usage with ggplot2).
fortify.ts
plot.ts, fortify
plot.ts
fortify
# NOT RUN { library(ggplot2) autoplot(USAccDeaths) lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) autoplot(lungDeaths, facets=TRUE) # }
Run the code above in your browser using DataLab