QASA_TABLE720R %>%
filter(LOCATION == "DEU",
# RS129: Pension funds
SECTOR == "RS129",
MEASURE == "CAR",
# LBF90NC: Financial net worth
# LFASNC: Financial assets
# LFLINC: Financial liabilities
TRANSACTION %in% c("LBF90NC", "LFASNC", "LFLINC")) %>%
right_join(QASA_TABLE720R_var$TRANSACTION %>%
select(TRANSACTION = id, TRANSACTION_desc = label),
by = "TRANSACTION") %>%
filter(obsValue != 0) %>%
arrange(-obsValue) %>%
quarter_to_date %>%
mutate(obsValue = obsValue / 1000) %>%
select(date, TRANSACTION, TRANSACTION_desc, obsValue) %>%
ggplot() +
geom_line(aes(x = date, y = obsValue, color = TRANSACTION_desc, linetype = TRANSACTION_desc)) +
theme_minimal() +
scale_color_manual(values = viridis(5)[1:4]) +
scale_x_date(breaks = as.Date(paste0(seq(1960, 2020, 1), "-01-01")),
labels = date_format("%Y")) +
theme(legend.position = c(0.4, 0.9),
legend.title = element_blank()) +
xlab("") + ylab("Euros Managed") +
scale_y_continuous(breaks = seq(0, 4000, 100),
labels = dollar_format(suffix = " Bn€", prefix = "", accuracy = 1))