Fiscal Monitor (FM) - FM

Data - IMF

Structure

France, Germany, Italy

Code
FM |>
  filter(COUNTRY %in% c("ITA", "FRA", "DEU", "USA"),
         INDICATOR == "GPB_S13_POGDP_PT") |>
  add_flag_color("Country") |>
  mutate(OBS_VALUE = OBS_VALUE/100,
         date = as.Date(paste0(TIME_PERIOD, "-01-01")),
         obsValue = OBS_VALUE,
         Ref_area = Country) |>
  ggplot() + geom_line(aes(x = date, y = OBS_VALUE, color = color)) + 
  theme_minimal() + xlab("") + ylab("Déficit primaire, % du PIB") +
  scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1920, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = 0.01*seq(-60, 60, 1),
                     labels = scales::percent_format(accuracy = 1)) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black")