# \donttest{
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))
# Allow for nonrejected series to be plotted
autoplot(rsim_data, nonrejected = TRUE)
# Remove the shading completely (2 ways)
autoplot(rsim_data, shade_opt = NULL)
autoplot(rsim_data, shade_opt = shade(opacity = 0))
# Plot only the series with the shading options
autoplot2(rsim_data)
autoplot2(rsim_data, trunc = FALSE) # keep the minw period
# 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")
# }
Run the code above in your browser using DataLab