jt.data.1.AllItems |>
filter(series_id %in% c("JTS000000000000000HIL",
"JTS000000000000000TSL")) |>
left_join(jt.series, by = "series_id") |>
left_join(jt.dataelement, by = "dataelement_code") |>
month_to_date() |>
ggplot() +
geom_line(aes(x = date, y = value, color = dataelement_text)) +
theme_minimal() +
theme(legend.title = element_blank(),
legend.position = c(0.6, 0.85)) +
scale_x_date(breaks = as.Date(paste0(seq(1930, 2100, 2), "-01-01")),
labels = date_format("%Y")) +
geom_rect(data = nber_recessions |>
filter(Peak > as.Date("1996-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
fill = 'grey', alpha = 0.5) +
scale_y_continuous(breaks = 1000*seq(0, 20, 1),
labels = dollar_format(suffix = "K", prefix = ""),
limits = c(3000, 9000)) +
xlab("") + ylab("Monthly Levels ('000s)")