| autolayer.mts | R Documentation |
autoplot takes an object of type ts or mts and creates
a ggplot object suitable for usage with stat_forecast.
## S3 method for class 'mts'
autolayer(object, colour = TRUE, series = NULL, ...)
## S3 method for class 'msts'
autolayer(object, series = NULL, ...)
## S3 method for class 'ts'
autolayer(object, colour = TRUE, series = NULL, ...)
## S3 method for class 'ts'
autoplot(
object,
series = NULL,
xlab = "Time",
ylab = deparse1(substitute(object)),
main = NULL,
...
)
## S3 method for class 'mts'
autoplot(
object,
colour = TRUE,
facets = FALSE,
xlab = "Time",
ylab = deparse1(substitute(object)),
main = NULL,
...
)
## S3 method for class 'msts'
autoplot(object, ...)
## S3 method for class 'ts'
fortify(model, data, ...)
object |
Object of class |
colour |
If |
series |
Identifies the time series with a colour, which integrates well
with the functionality of |
... |
Other plotting parameters to affect the plot. |
xlab |
X-axis label. |
ylab |
Y-axis label. |
main |
Main title. |
facets |
If |
model |
Object of class |
data |
Not used (required for |
fortify.ts takes a ts object and converts it into a data frame
(for usage with ggplot2).
None. Function produces a ggplot graph.
Mitchell O'Hara-Wild
stats::plot.ts(), ggplot2::fortify()
library(ggplot2)
autoplot(USAccDeaths)
lungDeaths <- cbind(mdeaths, fdeaths)
autoplot(lungDeaths)
autoplot(lungDeaths, facets = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.