World Economic Outlook, October 2019 - WEO_PUB_OCT2019

Data - IMF

SUBJECT / CONCEPT

Code
WEO %>%
  left_join(CONCEPT, by = "CONCEPT") %>%
  left_join(UNIT, by = "UNIT") %>%
  group_by(CONCEPT, Concept, Unit) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Country

Code
WEO %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_area))),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

Output gap (% of Potential Output)

Italy, France, Greece, Spain, Germany

Flag colors

Code
WEO %>%
  time_to_date %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(CONCEPT == "NGAP_NPGDP",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.15, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Output Gap (% of Potential Output)") + xlab("")

Flags

Code
WEO %>%
  time_to_date %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(CONCEPT == "NGAP_NPGDP",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  geom_image(data = . %>%
               filter(date == as.Date("2014-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  theme(legend.position = c(0.15, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Output Gap (% of Potential Output)") + xlab("")

Flags / No Legends

Code
WEO %>%
  time_to_date %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(CONCEPT == "NGAP_NPGDP",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  geom_image(data = . %>%
               filter(date == as.Date("2014-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  theme(legend.position = "none") +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Output Gap (% of Potential Output)") + xlab("")

Flags / No Legends

Code
WEO %>%
  time_to_date %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(CONCEPT == "NGAP_NPGDP",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01"),
         date <= as.Date("2019-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  geom_image(data = . %>%
               filter(date == as.Date("2014-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  theme(legend.position = "none") +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Output Gap (% of Potential Output)") + xlab("")

Flags / No Legends (français)

Code
WEO %>%
  time_to_date %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(CONCEPT == "NGAP_NPGDP",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  geom_image(data = . %>%
               filter(date == as.Date("2014-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  theme(legend.position = "none") +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Ecarts de Production (% de PIB Potentiel)") + xlab("")

Date

Code
WEO %>%
  group_by(TIME_PERIOD) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Real Growth Rates

All

Code
WEO %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  time_to_date %>%
  filter(CONCEPT == "NGDP_RPCH",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  geom_image(data = . %>%
               filter(date == as.Date("2011-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.15, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Real Growth Rate") + xlab("")

1990-

Code
WEO %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  time_to_date %>%
  filter(CONCEPT == "NGDP_RPCH",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("1990-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  geom_image(data = . %>%
               filter(date == as.Date("2011-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.15, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Real Growth Rate") + xlab("")

2000-

Code
WEO %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  time_to_date %>%
  filter(CONCEPT == "NGDP_RPCH",
         Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany"),
         date >= as.Date("2000-01-01")) %>%
  ggplot() + 
  geom_line(aes(x = date, y = OBS_VALUE/100, color = Ref_area)) +
  geom_image(data = . %>%
               filter(date == as.Date("2011-01-01")) %>%
               mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Ref_area)), ".png")),
             aes(x = date, y = OBS_VALUE/100, image = image), asp = 1.5) +
  scale_color_manual(values = c("#ED2939", "#000000", "#0D5EAF", "#009246", "#FFC400")) +
  theme_minimal() +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  theme(legend.position = c(0.15, 0.2),
        legend.title = element_blank()) +
  scale_y_continuous(breaks = 0.01*seq(-90, 90, 2),
                     labels = percent_format(accuracy = 1)) +
  ylab("Real Growth Rate") + xlab("")