Last observation: 2024 (N = 81)
First observation: 1948 (N = 73)
Last data update: 23 sept. 2026, 21:38
Last compile: 23 sept. 2026, 21:42
T11300_A |>
year_to_date() |>
mutate(year = year(date)) |>
filter(year %in% c(1929, 1949, 1969, 1989, 2009, 2019)) |>
group_by(year) |>
mutate(value = round(100*DataValue/DataValue[1], 1)) |>
ungroup() |>
select(LineNumber, LineDescription, year, value) |>
spread(year, value) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}ni_total <- T11300_A |> filter(LineNumber == 1) |> select(TimePeriod, total = DataValue)
T11300_A |>
filter(LineNumber %in% c(3, 19, 28, 41, 56)) |>
left_join(ni_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("1929-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
fill = 'grey', alpha = 0.5) +
scale_x_date(breaks = seq(1920, 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 national income") + xlab("")