Description Usage Arguments Value Examples
View source: R/autoplot-radf.R
autoplot.radf_obj
takes radf_obj
and radf_cv
and returns a faceted ggplot object.
shade
is used as an input to shape_opt
. shade
modifies the
geom_rect layer that demarcates the exuberance periods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
object |
An object of class |
cv |
An object of class |
option |
Whether to apply the "gsadf" or "sadf" methodology (default = "gsadf"). |
min_duration |
The minimum duration of an explosive period for it to be reported (default = 0). |
select_series |
A vector of column names or numbers specifying the series to be used in plotting. Note that the order of the series does not alter the order used in plotting. |
include_negative |
If TRUE, plot all variables regardless of rejecting the NULL at the 5 percent significance level. |
shade_opt |
Shading options, typically set using |
include |
Argument name is deprecated and substituted with |
select |
Argument name is deprecated and substituted with |
... |
Further arguments passed to |
fill |
The shade color that indicates the exuberance periods. |
opacity |
The opacity of the shade color aka alpha. |
A ggplot2::ggplot()
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 | rsim_data <- radf(sim_data_wdate)
autoplot(rsim_data)
# Modify facet_wrap options through ellipsis
autoplot(rsim_data, scales = "free_y", dir = "v")
# Modify the shading options
autoplot(rsim_data, shade_opt = shade(fill = "pink", opacity = 0.5))
# Or remove the shading completely
autoplot(rsim_data, shade_opt = shade(opacity = 0))
# We will need ggplot2 from here on out
library(ggplot2)
# Change (overwrite) color, size or linetype
autoplot(rsim_data) +
scale_color_manual(values = c("black", "black")) +
scale_size_manual(values = c(0.9, 1)) +
scale_linetype_manual(values = c("solid", "solid"))
# Change names through labeller (first way)
custom_labels <- c("psy1" = "new_name_for_psy1", "psy2" = "new_name_for_psy2")
autoplot(rsim_data, labeller = labeller(.default = label_value, id = as_labeller(custom_labels)))
# Change names through labeller (second way)
custom_labels2 <- series_names(rsim_data)
names(custom_labels2) <- custom_labels2
custom_labels2[c(3,5)] <- c("Evans", "Blanchard")
autoplot(rsim_data, labeller = labeller(id = custom_labels2))
# Or change names before plotting
series_names(rsim_data) <- LETTERS[1:5]
autoplot(rsim_data)
# Change Theme options
autoplot(rsim_data) +
theme(legend.position = "right")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.