GOV |>
filter(COU %in% c("FRA", "DEU"),
IND == "GINV_GDP") |>
year_to_date() |>
left_join(GOV_var$COU, by = "COU") |>
ggplot() + geom_line(aes(x = date, y = obsValue/100, color = Cou)) +
theme_minimal() + ylab("Government investment (% of GDP)") + xlab("") +
geom_image(data = . %>%
filter(date == as.Date("2014-01-01")) %>%
mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Cou)), ".png")),
aes(x = date, y = obsValue/100, image = image), asp = 1.5) +
scale_color_manual(values = c("#002395", "#000000")) +
theme(legend.position = "none") +
scale_x_date(breaks = seq(1920, 2100, 1) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 60, 0.2),
labels = scales::percent_format(accuracy = .1))