Code
GFSE |>
left_join(INDICATOR, by = "INDICATOR") |>
group_by(INDICATOR, Indicator) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}Data - IMF
GFSE |>
left_join(INDICATOR, by = "INDICATOR") |>
group_by(INDICATOR, Indicator) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}GFSE |>
left_join(SECTOR, by = "SECTOR") |>
group_by(SECTOR, Sector) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}| SECTOR | Sector | Nobs |
|---|---|---|
| S1311B | Budgetary central government | 176362 |
| S1321 | Central government (incl. social security funds) | 136991 |
| S1311 | Central government (excl. social security funds) | 119075 |
| S13 | General government | 115125 |
| S1314 | Social security funds | 112229 |
| S1313 | Local governments | 108804 |
| S13112 | Extrabudgetary central government | 67887 |
| S1312 | State governments | 34689 |
GFSE |>
left_join(iso2c, by = "iso2c") |>
group_by(iso2c, Iso2c) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}GFSE |>
group_by(CLASSIFICATION) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}GFSE |>
left_join(CL_UNIT_GFSE, by = "UNIT") |>
group_by(UNIT, UNIT_desc) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}| UNIT | UNIT_desc | Nobs |
|---|---|---|
| XDC | Domestic currency | 436756 |
| XDC_R_B1GQ | Percent of GDP | 434406 |
GFSE |>
left_join(SECTOR, by = "SECTOR") |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W0_S1_G24",
UNIT == "XDC_R_B1GQ",
SECTOR == "S1321") |>
group_by(iso2c, Iso2c) |>
summarise(Nobs = n(),
year1 = first(year(date)),
value1 = first(round(value, 1)),
year2 = last(year(date)),
value2 = last(round(value, 1))) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}GFSE |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W0_S1_G24",
UNIT == "XDC_R_B1GQ",
iso2c %in% c("AT", "AU", "CY"),
SECTOR == "S1321") |>
mutate(value = value/100) |>
left_join(colors, by = c("Iso2c" = "country")) |>
ggplot() + scale_color_identity() + add_flags + geom_line(aes(x = date, y = value, color = color)) + theme_minimal() +
xlab("") + ylab("Interest Payments (% of GDP)") +
theme(legend.title = element_blank(),
legend.position = c(0.15, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")
GFSE |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W0_S1_G24",
UNIT == "XDC_R_B1GQ",
iso2c %in% c("DE", "FR", "IT"),
SECTOR == "S1321") |>
mutate(value = value/100) |>
left_join(colors, by = c("Iso2c" = "country")) |>
ggplot() + scale_color_identity() + add_flags + geom_line(aes(x = date, y = value, color = color)) + theme_minimal() +
xlab("") + ylab("Interest Payments (% of GDP)") +
theme(legend.title = element_blank(),
legend.position = c(0.15, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")
GFSE |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W0_S1_G24",
UNIT == "XDC_R_B1GQ",
iso2c %in% c("GB", "IE", "US"),
SECTOR == "S1321") |>
mutate(value = value/100) |>
left_join(colors, by = c("Iso2c" = "country")) |>
ggplot() + scale_color_identity() + add_flags + geom_line(aes(x = date, y = value, color = color)) + theme_minimal() +
xlab("") + ylab("Interest Payments (% of GDP)") +
theme(legend.title = element_blank(),
legend.position = c(0.85, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")
GFSE |>
left_join(SECTOR, by = "SECTOR") |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W1_S1_G24",
UNIT == "XDC_R_B1GQ",
SECTOR == "S1321") |>
group_by(iso2c, Iso2c) |>
summarise(Nobs = n(),
year1 = first(year(date)),
value1 = first(round(value, 1)),
year2 = last(year(date)),
value2 = last(round(value, 1))) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}GFSE |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W1_S1_G24",
UNIT == "XDC_R_B1GQ",
iso2c %in% c("CG", "KI", "SV"),
SECTOR == "S1321") |>
mutate(value = value/100) |>
left_join(colors, by = c("Iso2c" = "country")) |>
ggplot() + geom_line() + theme_minimal() + scale_color_identity() + add_flags +
aes(x = date, y = value, color = color) +
xlab("") + ylab("Interest Payments to Non Residents (% of GDP)") +
theme(legend.title = element_blank(),
legend.position = c(0.85, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")
GFSE |>
left_join(iso2c, by = "iso2c") |>
filter(INDICATOR == "W1_S1_G24",
UNIT == "XDC_R_B1GQ",
iso2c %in% c("US", "PE", "IL"),
SECTOR == "S1321") |>
mutate(value = value/100) |>
left_join(colors, by = c("Iso2c" = "country")) |>
ggplot() + geom_line() + theme_minimal() + scale_color_identity() + add_flags +
aes(x = date, y = value, color = color) +
xlab("") + ylab("Interest Payments to Non Residents (% of GDP)") +
theme(legend.title = element_blank(),
legend.position = c(0.85, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 1),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")