CREDIT_GAP %>%
arrange(iso3c, date) %>%
group_by(iso3c, iso2c, `Borrowers' country`) %>%
summarise(Nobs = n(),
start = first(date),
end = last(date)) %>%
arrange(-Nobs) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(`Borrowers' country`)),
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 .}
CREDIT_GAP %>%
group_by(FREQ, Frequency) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional()
FREQ | Frequency | Nobs |
---|---|---|
Q | Quarterly | 21980 |
CREDIT_GAP %>%
group_by(CG_DTYPE, `Credit gap data type`) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional()
CG_DTYPE | Credit gap data type | Nobs |
---|---|---|
A | Credit-to-GDP ratios (actual data) | 8500 |
B | Credit-to-GDP trend (HP filter) | 6740 |
C | Credit-to-GDP gaps (actual-trend) | 6740 |
CREDIT_GAP %>%
group_by(TC_LENDERS, `Lending sector`) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional()
TC_LENDERS | Lending sector | Nobs |
---|---|---|
A | All sectors | 21980 |
CREDIT_GAP %>%
group_by(TC_BORROWERS, `Borrowing sector`) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional()
TC_BORROWERS | Borrowing sector | Nobs |
---|---|---|
P | Private non-financial sector | 21980 |
CREDIT_GAP %>%
group_by(TC_LENDERS, `Lending sector`) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
print_table_conditional()
TC_LENDERS | Lending sector | Nobs |
---|---|---|
A | All sectors | 21980 |
CREDIT_GAP %>%
filter(CG_DTYPE == "A",
iso3c %in% c("ESP", "USA", "ITA")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 300, 20),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "C",
iso3c %in% c("ESP", "USA", "ITA")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 300, 20),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "A",
iso3c %in% c("DNK", "NLD", "DEU")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 300, 20),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "C",
iso3c %in% c("DNK", "NLD", "DEU")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.15, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 300, 10),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "A",
iso3c %in% c("IRL", "ESP", "PRT")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 600, 20),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "C",
iso3c %in% c("IRL", "ESP", "PRT")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.15, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-300, 300, 10),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "A",
iso3c %in% c("FRA", "ESP", "ITA")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.2, 0.85),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-60, 300, 20),
labels = scales::percent_format(accuracy = 1))
CREDIT_GAP %>%
filter(CG_DTYPE == "C",
iso3c %in% c("FRA", "ESP", "ITA")) %>%
left_join(colors, by = c("Borrowers' country" = "country")) %>%
ggplot() + theme_minimal() + ylab("Credit-to-GDP ratio") + xlab("") +
geom_line(aes(x = date, y = value/100, color = color)) +
scale_color_identity() + add_flags +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.15, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-300, 300, 10),
labels = scales::percent_format(accuracy = 1))