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 .}Data - IMF
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 .}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 .}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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
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("")
WEO |>
group_by(TIME_PERIOD) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}WEO |>
left_join(REF_AREA, by = "REF_AREA") |>
time_to_date() |>
filter(CONCEPT == "NGDP_RPCH",
Ref_area %in% c("Italy", "France", "Greece", "Spain", "Germany")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 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("")
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")) |>
mutate(OBS_VALUE = OBS_VALUE/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags +
geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
theme_minimal() +
scale_x_date(breaks = seq(1920, 2100, 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("")