Last observation: 2025 (N = 44)
First observation: 1929 (N = 36)
Last data update: 23 sept. 2026, 21:38
Last compile: 23 sept. 2026, 21:43
gdp_A <- read_parquet("gdp_A.parquet") |>
mutate(year = year(date)) |>
select(year, gdp = value)
T30300_A |>
filter(LineNumber %in% c(35, 38, 32)) |>
year_to_date() |>
mutate(year = year(date),
LineDescription = case_when(LineNumber == 35 ~ "Total receipts",
LineNumber == 38 ~ "Total expenditures",
LineNumber == 32 ~ "Net saving")) |>
left_join(gdp_A, by = "year") |>
mutate(share = DataValue/gdp) |>
ggplot() + theme_minimal() +
geom_line(aes(x = date, y = share, color = LineDescription)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey50") +
geom_rect(data = nber_recessions |>
filter(Peak > as.Date("1959-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
fill = 'grey', alpha = 0.5) +
scale_x_date(breaks = seq(1930, 2100, 10) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(3)) +
theme(legend.title = element_blank(),
legend.position = "bottom") +
ylab("% of GDP") + xlab("")
receipts_total <- T30300_A |> filter(LineNumber == 1) |> select(TimePeriod, total = DataValue)
T30300_A |>
filter(LineNumber %in% c(3, 6, 11, 12, 18)) |>
left_join(receipts_total, by = "TimePeriod") |>
mutate(share = DataValue/total) |>
year_to_date() |>
ggplot() + theme_minimal() +
geom_line(aes(x = date, y = share, color = LineDescription)) +
geom_rect(data = nber_recessions |>
filter(Peak > as.Date("1959-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
fill = 'grey', alpha = 0.5) +
scale_x_date(breaks = seq(1930, 2100, 10) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)) +
theme(legend.title = element_blank(),
legend.position = "bottom") +
ylab("% of current receipts") + xlab("")