-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathautoplot.ts.Rd
142 lines (107 loc) · 3.16 KB
/
autoplot.ts.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/base_fortify_ts.R
\name{autoplot.ts}
\alias{autoplot.ts}
\alias{autoplot.xts}
\alias{autoplot.timeSeries}
\alias{autoplot.irts}
\alias{autoplot.stl}
\alias{autoplot.decomposed.ts}
\title{Autoplot time-series-like}
\usage{
\method{autoplot}{ts}(
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,
...
)
}
\arguments{
\item{object}{time-series-like instance}
\item{columns}{Character vector specifies target column name(s)}
\item{group}{Character vector specifies grouping}
\item{is.date}{Logical frag indicates whether the \code{stats::ts} is date or not
If not provided, regard the input as date when the frequency is 4 or 12}
\item{index.name}{Specify column name for time series index when passing \code{data.frame} via data.}
\item{p}{\code{ggplot2::ggplot} instance}
\item{ts.scale}{Logical flag indicating whether to perform scaling each timeseries}
\item{stacked}{Logical flag indicating whether to stack multivariate timeseries}
\item{facets}{Logical value to specify use facets}
\item{nrow}{Number of facet/subplot rows}
\item{ncol}{Number of facet/subplot columns}
\item{scales}{Scale value passed to \code{ggplot2}}
\item{ts.geom}{geometric string for time-series. 'line', 'bar', 'ribbon', or 'point'}
\item{ts.colour}{line colour for time-series}
\item{ts.size}{point size for time-series}
\item{ts.linetype}{line type for time-series}
\item{ts.alpha}{alpha for time-series}
\item{ts.fill}{fill colour for time-series}
\item{ts.shape}{point shape for time-series}
\item{geom}{same as ts.geom}
\item{colour}{same as ts.colour}
\item{size}{same as ts.size}
\item{linetype}{same as ts.linetype}
\item{alpha}{same as ts.alpha}
\item{fill}{same as ts.fill}
\item{shape}{same as ts.shape}
\item{xlim}{limits for x axis}
\item{ylim}{limits for y axis}
\item{log}{which variables to log transform ("x", "y", or "xy")}
\item{main}{character vector or expression for plot title}
\item{xlab}{character vector or expression for x axis label}
\item{ylab}{character vector or expression for y axis label}
\item{asp}{the y/x aspect ratio}
\item{...}{other arguments passed to methods}
}
\value{
ggplot
}
\description{
Autoplot time-series-like
}
\examples{
\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))
}
}