Plot methods for objects of class "tscomparison", threeRuleSmooth
and twoStepsBenchmark. :
plot draws a plot with base graphics
autoplot produces a ggplot object
Objects of class tscomparison can be produced with the functions
in_sample, in_scatter, in_revisions, in_disaggr.
# S3 method for twoStepsBenchmark
plot(
x,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(x),
lty = default_lty_pal(x),
show.legend = TRUE,
main = NULL,
mar = default_margins(main, xlab, ylab),
...
)# S3 method for threeRuleSmooth
plot(
x,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(x),
lty = default_lty_pal(x),
show.legend = TRUE,
main = NULL,
mar = default_margins(main, xlab, ylab),
...
)
# S3 method for tscomparison
plot(
x,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(x),
lty = default_lty_pal(x),
show.legend = TRUE,
main = NULL,
mar = default_margins(main, xlab, ylab),
...
)
# S3 method for twoStepsBenchmark
autoplot(
object,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(object),
lty = default_lty_pal(object),
show.legend = TRUE,
main = NULL,
mar = NULL,
theme = default_theme_ggplot(object, start, end, show.legend, xlab, ylab, mar),
...
)
# S3 method for threeRuleSmooth
autoplot(
object,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(object),
lty = default_lty_pal(object),
show.legend = TRUE,
main = NULL,
mar = NULL,
theme = default_theme_ggplot(object, start, end, show.legend, xlab, ylab, mar),
...
)
# S3 method for tscomparison
autoplot(
object,
xlab = NULL,
ylab = NULL,
start = NULL,
end = NULL,
col = default_col_pal(object),
lty = default_lty_pal(object),
show.legend = TRUE,
main = NULL,
mar = NULL,
theme = default_theme_ggplot(object, start, end, show.legend, xlab, ylab, mar),
...
)
NULL for the plot methods, the ggplot object for the autoplot
methods
(for the plot method) a tscomparison, a twoStepsBenchmark or a threeRuleSmooth.
the title for the x axis
the title for the y axis
a numeric of length 1 or 2. The start of the plot.
a numeric of length 1 or 2. The end of the plot.
the color scale applied on the plot. Could be a vector of colors, or a function from n to a color vector of size n.
the linetype scales applied on the plot. Could be a vector of linetypes, or a function from n to a linetypes vector of size n.
TRUE or FALSE. Should an automatic legend be added to
the plot.
a character of length 1, the title of the plot
a numeric of length 4, the margins of the plot specified in the
form c(bottom, left, top, right).
other arguments passed either to ggplot or plot
(for the autoplot method) a tscomparison, a twoStepsBenchmark or a threeRuleSmooth.
a ggplot theme object to replace the default one (only for autoplot methods)
benchmark <- twoStepsBenchmark(turnover,construction,include.rho = TRUE)
plot(benchmark)
plot(in_sample(benchmark))
if(require("ggplot2")) {
autoplot(in_disaggr(benchmark,type="changes"),
start=c(2015,1),
end=c(2020,12))
}
plot(in_scatter(benchmark),xlab="title x",ylab="title y")
Run the code above in your browser using DataLab