| bcat_plt_ts | R Documentation |
Create a time series visualization with UC styling. Supports decomposition into trend/seasonal/remainder, ACF/PACF display, and recession shading.
bcat_plt_ts(
df,
x = NULL,
y = NULL,
color = NULL,
decompose = FALSE,
acf = FALSE,
recession_bars = NULL,
x_lab = ggplot2::waiver(),
y_lab = ggplot2::waiver(),
title = ggplot2::waiver(),
subtitle = ggplot2::waiver(),
caption = ggplot2::waiver(),
legend_lab = ggplot2::waiver(),
legend_position = "bottom",
legend_hide = FALSE,
x_scale = NULL,
y_scale = NULL,
color_scale = scale_colour_UC(),
layer_points = FALSE,
x_highlight_min = NULL,
x_highlight_max = NULL,
y_refline = NULL
)
df |
A data frame with date and value columns. |
x |
Date column. |
y |
Value column. |
color |
Variable for color aesthetic. |
decompose |
Logical. Show 4-panel decomposition? Default is FALSE. |
acf |
Logical. Show ACF/PACF side-by-side? Default is FALSE. |
recession_bars |
Data frame with |
x_lab |
Label for x-axis. |
y_lab |
Label for y-axis. |
title |
Plot title. |
subtitle |
Plot subtitle. |
caption |
Plot caption. |
legend_lab |
Legend title. |
legend_position |
Legend position. |
legend_hide |
Logical. Hide legend? |
x_scale |
|
y_scale |
|
color_scale |
|
layer_points |
Logical. Show points on line? Default is FALSE. |
x_highlight_min |
Date(s) at which to start highlight region(s). |
x_highlight_max |
Date(s) at which to end highlight region(s). |
y_refline |
Horizontal reference line(s). |
A ggplot or patchwork object.
Saannidhya Rawat
Other plots:
bcat_plt_area(),
bcat_plt_bar(),
bcat_plt_box(),
bcat_plt_coef(),
bcat_plt_diag(),
bcat_plt_hist(),
bcat_plt_line(),
bcat_plt_point()
library(ggplot2)
library(scales)
bcat_plt_ts(economics, x = date, y = unemploy,
y_scale = scale_y_continuous(labels = comma_format()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.