Gross saving, Net saving, CCA
T50100 %>% filter(FREQ == "A") %>% select(-FREQ) %>%
mutate(table = "T50100") %>%
bind_rows(T10105_A %>%
mutate(table = "T10105")) %>%
year_to_date %>%
group_by(date) %>%
mutate(value = DataValue/DataValue[LineNumber == 1 & table == "T10105"]) %>%
filter(LineNumber %in% c(1, 2, 13) & table == "T50100") %>%
ggplot(.) + theme_minimal() +
geom_line(aes(x = date, y = value, color = LineDescription)) +
theme(legend.title = element_blank(),
legend.position = c(0.5, 0.15)) +
geom_rect(data = nber_recessions %>%
filter(Peak > as.Date("1928-01-01")),
aes(xmin = Peak, xmax = Trough, ymin = -Inf, ymax = +Inf),
fill = 'grey', alpha = 0.5) +
scale_x_date(breaks = seq(1930, 2100, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%Y")) +
ylab("% of GDP") + xlab("") +
scale_y_continuous(breaks = 0.01*seq(-100, 100, 2),
labels = scales::percent_format(accuracy = 1))