FD.AST.PRVT.GD.ZS %>%
left_join(iso2c, by = "iso2c") %>%
group_by(iso2c, Iso2c) %>%
rename(value = `FD.AST.PRVT.GD.ZS`) %>%
mutate(value = round(value, 2)) %>%
summarise(Nobs = n(),
`Year 1` = first(year),
`HH Consumption 1 (%)` = first(value),
`Year 2` = last(year),
`HH Consumption 2 (%)` = last(value)) %>%
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("IT", "FR", "DE")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.8, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 2) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 10),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("JP", "CH")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.8, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 20),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("CN", "US")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.2, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 20),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("CN", "FR", "DE")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.15, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 20),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("US", "GB", "ES")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.4, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 20),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("AR", "CL", "VE")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.8, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 400, 10),
labels = scales::percent_format(accuracy = 1))
FD.AST.PRVT.GD.ZS %>%
filter(iso2c %in% c("GR", "HK", "MX")) %>%
left_join(iso2c, by = "iso2c") %>%
year_to_enddate %>%
ggplot(.) + theme_minimal() + geom_line() +
aes(x = date, y = FD.AST.PRVT.GD.ZS/100, color = Iso2c, linetype = Iso2c) +
xlab("") + ylab("Domestic credit to private sector by banks (% of GDP)") +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.title = element_blank(),
legend.position = c(0.8, 0.9)) +
scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
scale_y_continuous(breaks = 0.01*seq(0, 2000, 10),
labels = scales::percent_format(accuracy = 1))