library(MiscImport) library(tidyverse)
credit_df = import_boi_credit_df(download_file = TRUE)
credit_df %>% filter(lender == "banks") %>% filter(!borrower %in% c("all_sectors","gov_sector")) %>% filter(!category == "total" | is.na(category)) %>% filter((instrument == "all_instruments") | is.na(instrument)) %>% filter(!is.na(value)) %>% group_by(date) %>% mutate(value = value / sum(value)) %>% ungroup() %>% filter(category == "residental") %>% ggplot(aes(date, value)) + geom_line() + scale_y_continuous(labels = scales::percent_format(accuracy = 1)) + xlab(NULL) + ylab(NULL) + ggtitle("Share of residental credit out of total banking private credit")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.