Autoplot time-series-like
# S3 method for class 'ts'
autoplot(
object,
columns = NULL,
group = NULL,
is.date = NULL,
index.name = "Index",
p = NULL,
ts.scale = FALSE,
stacked = FALSE,
facets = TRUE,
nrow = NULL,
ncol = 1,
scales = "free_y",
ts.geom = "line",
ts.colour = NULL,
ts.size = NULL,
ts.linetype = NULL,
ts.alpha = NULL,
ts.fill = NULL,
ts.shape = NULL,
geom = ts.geom,
colour = ts.colour,
size = ts.size,
linetype = ts.linetype,
alpha = ts.alpha,
fill = ts.fill,
shape = ts.shape,
xlim = c(NA, NA),
ylim = c(NA, NA),
log = "",
main = NULL,
xlab = "",
ylab = "",
asp = NULL,
...
)
time-series-like instance
Character vector specifies target column name(s)
Character vector specifies grouping
Logical frag indicates whether the stats::ts
is date or not
If not provided, regard the input as date when the frequency is 4 or 12
Specify column name for time series index when passing data.frame
via data.
ggplot2::ggplot
instance
Logical flag indicating whether to perform scaling each timeseries
Logical flag indicating whether to stack multivariate timeseries
Logical value to specify use facets
Number of facet/subplot rows
Number of facet/subplot columns
Scale value passed to ggplot2
geometric string for time-series. 'line', 'bar', 'ribbon', or 'point'
line colour for time-series
point size for time-series
line type for time-series
alpha for time-series
fill colour for time-series
point shape for time-series
same as ts.geom
same as ts.colour
same as ts.size
same as ts.linetype
same as ts.alpha
same as ts.fill
same as ts.shape
limits for x axis
limits for y axis
which variables to log transform ("x", "y", or "xy")
character vector or expression for plot title
character vector or expression for x axis label
character vector or expression for y axis label
the y/x aspect ratio
other arguments passed to methods
ggplot
if (FALSE) { # \dontrun{
data(Canada, package = 'vars')
autoplot(AirPassengers)
autoplot(UKgas, ts.geom = 'bar')
autoplot(Canada)
autoplot(Canada, facets = FALSE)
library(zoo)
autoplot(xts::as.xts(AirPassengers))
autoplot(timeSeries::as.timeSeries(AirPassengers))
its <- tseries::irts(cumsum(rexp(10, rate = 0.1)), matrix(rnorm(20), ncol=2))
autoplot(its)
autoplot(stats::stl(UKgas, s.window = 'periodic'))
autoplot(stats::decompose(UKgas))
} # }