library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0      ✔ purrr   0.3.5 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.3      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(here)
## here() starts at /Users/yukinakagawa/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance
library(janitor)
## 
## Attaching package: 'janitor'
## 
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(countrycode)
library(readxl)
library(lubridate)
## Loading required package: timechange
## 
## Attaching package: 'lubridate'
## 
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
options(scipen=10) # forces regular notation vs scientific notation (ie5)

View Excel Sheets

here("~/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance/Sustainable_debt_monitor.xlsx")%>% excel_sheets()
##  [1] "Table of contents"               "Country coverage"               
##  [3] "1a_global markets - issuance"    "1b_global markets - outstanding"
##  [5] "2a_MM by country"                "2b_MM by sector"                
##  [7] "3a_EM&FM by country"             "3b_EM&FM by sector"             
##  [9] "4a_offshore centers by country"  "4b_offshore centers by sector"  
## [11] "5_supranationals by country"     "6_outstanding amt by country "  
## [13] "7_Share of ESG debt issuance"

Convert data to dataset

here("~/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance/Sustainable_debt_monitor.xlsx") %>%
# specify the sheet + the range of cells in excel
  read_excel(sheet = "1a_global markets - issuance",
             range = "B4:G41") %>%
  # rename the first column to "date"
  rename(date = `$ billion`) %>%
  # Tidy the dataset by making the column names into long format
  pivot_longer(cols = -date, names_to = "geography", values_to = "issuance_bn_usd") %>%
  # coerce the date column into a date object using lubridate::ymd() (year-month_date)
  mutate(date = ymd(date)) %>%
  # Add a column that includes the name of this specific data
  add_column(issuance_type = "Sustainable debt (bonds and loans)")
## # A tibble: 185 × 4
##    date       geography        issuance_bn_usd issuance_type                    
##    <date>     <chr>                      <dbl> <chr>                            
##  1 2013-03-31 Mature markets             6.19  Sustainable debt (bonds and loan…
##  2 2013-03-31 Emerging markets           0.451 Sustainable debt (bonds and loan…
##  3 2013-03-31 Offshore centers           0     Sustainable debt (bonds and loan…
##  4 2013-03-31 Supranationals             1.16  Sustainable debt (bonds and loan…
##  5 2013-03-31 Global                     7.80  Sustainable debt (bonds and loan…
##  6 2013-06-30 Mature markets             4.08  Sustainable debt (bonds and loan…
##  7 2013-06-30 Emerging markets           0.595 Sustainable debt (bonds and loan…
##  8 2013-06-30 Offshore centers           0     Sustainable debt (bonds and loan…
##  9 2013-06-30 Supranationals             0.106 Sustainable debt (bonds and loan…
## 10 2013-06-30 Global                     4.78  Sustainable debt (bonds and loan…
## # … with 175 more rows

Develop function

process_iif_gb_issuance <- function(range, issuance_type) {
 here("~/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance/Sustainable_debt_monitor.xlsx") %>%
    read_excel(sheet = "1a_global markets - issuance", range = range) %>%
    rename(date = `$ billion`) %>%
    pivot_longer(cols = -date, names_to = "geography", values_to = "issuance_bn_usd") %>%
    mutate(date = ymd(date)) %>%
    add_column(issuance_type = issuance_type)
}

Utilize function on bonds and loans data

bonds_and_loans <- process_iif_gb_issuance(range = "B4:G41", 
                                           issuance_type = "Sustainable debt (bonds and loans)")

bonds_and_loans
## # A tibble: 185 × 4
##    date       geography        issuance_bn_usd issuance_type                    
##    <date>     <chr>                      <dbl> <chr>                            
##  1 2013-03-31 Mature markets             6.19  Sustainable debt (bonds and loan…
##  2 2013-03-31 Emerging markets           0.451 Sustainable debt (bonds and loan…
##  3 2013-03-31 Offshore centers           0     Sustainable debt (bonds and loan…
##  4 2013-03-31 Supranationals             1.16  Sustainable debt (bonds and loan…
##  5 2013-03-31 Global                     7.80  Sustainable debt (bonds and loan…
##  6 2013-06-30 Mature markets             4.08  Sustainable debt (bonds and loan…
##  7 2013-06-30 Emerging markets           0.595 Sustainable debt (bonds and loan…
##  8 2013-06-30 Offshore centers           0     Sustainable debt (bonds and loan…
##  9 2013-06-30 Supranationals             0.106 Sustainable debt (bonds and loan…
## 10 2013-06-30 Global                     4.78  Sustainable debt (bonds and loan…
## # … with 175 more rows

Utilize function on sustainable bonds data

bonds <- process_iif_gb_issuance(range = "I4:N41", 
                                           issuance_type = "Sustainable bonds")

bonds
## # A tibble: 185 × 4
##    date       geography        issuance_bn_usd issuance_type    
##    <date>     <chr>                      <dbl> <chr>            
##  1 2013-03-31 Mature markets             0.507 Sustainable bonds
##  2 2013-03-31 Emerging markets           0     Sustainable bonds
##  3 2013-03-31 Offshore centers           0     Sustainable bonds
##  4 2013-03-31 Supranationals             1.16  Sustainable bonds
##  5 2013-03-31 Global                     1.67  Sustainable bonds
##  6 2013-06-30 Mature markets             1.58  Sustainable bonds
##  7 2013-06-30 Emerging markets           0     Sustainable bonds
##  8 2013-06-30 Offshore centers           0     Sustainable bonds
##  9 2013-06-30 Supranationals             0.106 Sustainable bonds
## 10 2013-06-30 Global                     1.69  Sustainable bonds
## # … with 175 more rows

Bind data

iif_issuance_data <- bonds_and_loans %>%
  bind_rows(bonds)

iif_issuance_data
## # A tibble: 370 × 4
##    date       geography        issuance_bn_usd issuance_type                    
##    <date>     <chr>                      <dbl> <chr>                            
##  1 2013-03-31 Mature markets             6.19  Sustainable debt (bonds and loan…
##  2 2013-03-31 Emerging markets           0.451 Sustainable debt (bonds and loan…
##  3 2013-03-31 Offshore centers           0     Sustainable debt (bonds and loan…
##  4 2013-03-31 Supranationals             1.16  Sustainable debt (bonds and loan…
##  5 2013-03-31 Global                     7.80  Sustainable debt (bonds and loan…
##  6 2013-06-30 Mature markets             4.08  Sustainable debt (bonds and loan…
##  7 2013-06-30 Emerging markets           0.595 Sustainable debt (bonds and loan…
##  8 2013-06-30 Offshore centers           0     Sustainable debt (bonds and loan…
##  9 2013-06-30 Supranationals             0.106 Sustainable debt (bonds and loan…
## 10 2013-06-30 Global                     4.78  Sustainable debt (bonds and loan…
## # … with 360 more rows

Load and bind data

loans <- process_iif_gb_issuance(range = "P4:U41", 
                                           issuance_type = "Sustainable loans")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(loans)

green_bonds <- process_iif_gb_issuance(range = "W4:AB41", 
                                           issuance_type = "Green bonds")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(green_bonds)

green_abs <- process_iif_gb_issuance(range = "AD4:AI41", 
                                           issuance_type = "Green ABS")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(green_abs)

sustainability_bonds <- process_iif_gb_issuance(range = "AK4:AP41", 
                                           issuance_type = "Sustainability bonds")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(sustainability_bonds)

social_bonds <- process_iif_gb_issuance(range = "AR4:AW41", 
                                           issuance_type = "Social bonds")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(social_bonds)

green_municipal_bonds <- process_iif_gb_issuance(range = "AY4:BD41", 
                                           issuance_type = "Green municipal bonds")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(green_municipal_bonds)

sustainability_linked_bonds <- process_iif_gb_issuance(range = "BF4:BK41", 
                                           issuance_type = "Sustainability-linked bonds")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(sustainability_linked_bonds)

green_loans <- process_iif_gb_issuance(range = "BM4:BR41", 
                                           issuance_type = "Green loans")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(green_loans)

sustainability_linked_loans <- process_iif_gb_issuance(range = "BT4:BY41", 
                                           issuance_type = "Sustainability-linked loans")

iif_issuance_data <- iif_issuance_data %>%
  bind_rows(sustainability_linked_loans)

Use glimpse to view data

iif_issuance_data %>% glimpse()
## Rows: 2,035
## Columns: 4
## $ date            <date> 2013-03-31, 2013-03-31, 2013-03-31, 2013-03-31, 2013-…
## $ geography       <chr> "Mature markets", "Emerging markets", "Offshore center…
## $ issuance_bn_usd <dbl> 6.18958089, 0.45115568, 0.00000000, 1.15915118, 7.7998…
## $ issuance_type   <chr> "Sustainable debt (bonds and loans)", "Sustainable deb…

Save data as csv file

here("~/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance/Sustainable_debt_monitor.xlsx")%>% excel_sheets()
##  [1] "Table of contents"               "Country coverage"               
##  [3] "1a_global markets - issuance"    "1b_global markets - outstanding"
##  [5] "2a_MM by country"                "2b_MM by sector"                
##  [7] "3a_EM&FM by country"             "3b_EM&FM by sector"             
##  [9] "4a_offshore centers by country"  "4b_offshore centers by sector"  
## [11] "5_supranationals by country"     "6_outstanding amt by country "  
## [13] "7_Share of ESG debt issuance"
write_csv(iif_issuance_data, here("~/Desktop/SAIS/Academics/Fall 2022/Sustainable Finance/iif_issuance_data_2022-Oct.csv"))

Plot the csv file data

library(ggplot2)
library(dplyr)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
iif_issuance_data_overall_debt_mature <- filter(iif_issuance_data, issuance_type == "Sustainable debt (bonds and loans)", geography == "Mature markets")

p <- iif_issuance_data_overall_debt_mature %>%
  ggplot( aes(x=date, y=issuance_bn_usd)) +
    geom_line(color="red") +
    ylab("issuance_bn_usd")
    theme_dark()
## List of 94
##  $ line                      :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                      :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                      :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                     : NULL
##  $ aspect.ratio              : NULL
##  $ axis.title                : NULL
##  $ axis.title.x              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top          :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom       : NULL
##  $ axis.title.y              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left         : NULL
##  $ axis.title.y.right        :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top           :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom        : NULL
##  $ axis.text.y               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left          : NULL
##  $ axis.text.y.right         :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : 'rel' num 0.5
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x              : NULL
##  $ axis.ticks.x.top          : NULL
##  $ axis.ticks.x.bottom       : NULL
##  $ axis.ticks.y              : NULL
##  $ axis.ticks.y.left         : NULL
##  $ axis.ticks.y.right        : NULL
##  $ axis.ticks.length         : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x       : NULL
##  $ axis.ticks.length.x.top   : NULL
##  $ axis.ticks.length.x.bottom: NULL
##  $ axis.ticks.length.y       : NULL
##  $ axis.ticks.length.y.left  : NULL
##  $ axis.ticks.length.y.right : NULL
##  $ axis.line                 : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x               : NULL
##  $ axis.line.x.top           : NULL
##  $ axis.line.x.bottom        : NULL
##  $ axis.line.y               : NULL
##  $ axis.line.y.left          : NULL
##  $ axis.line.y.right         : NULL
##  $ legend.background         :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin             : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing            : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x          : NULL
##  $ legend.spacing.y          : NULL
##  $ legend.key                :List of 5
##   ..$ fill         : chr "grey50"
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.key.size           : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height         : NULL
##  $ legend.key.width          : NULL
##  $ legend.text               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.align         : NULL
##  $ legend.title              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.align        : NULL
##  $ legend.position           : chr "right"
##  $ legend.direction          : NULL
##  $ legend.justification      : chr "center"
##  $ legend.box                : NULL
##  $ legend.box.just           : NULL
##  $ legend.box.margin         : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background     : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing        : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ panel.background          :List of 5
##   ..$ fill         : chr "grey50"
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ panel.border              : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ panel.spacing             : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ panel.spacing.x           : NULL
##  $ panel.spacing.y           : NULL
##  $ panel.grid                :List of 6
##   ..$ colour       : chr "grey42"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ panel.grid.major          :List of 6
##   ..$ colour       : NULL
##   ..$ linewidth    : 'rel' num 0.5
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ panel.grid.minor          :List of 6
##   ..$ colour       : NULL
##   ..$ linewidth    : 'rel' num 0.25
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ panel.grid.major.x        : NULL
##  $ panel.grid.major.y        : NULL
##  $ panel.grid.minor.x        : NULL
##  $ panel.grid.minor.y        : NULL
##  $ panel.ontop               : logi FALSE
##  $ plot.background           :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : chr "white"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ plot.title                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 1.2
##   ..$ hjust        : num 0
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 5.5points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ plot.title.position       : chr "panel"
##  $ plot.subtitle             :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 5.5points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ plot.caption              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 5.5points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ plot.caption.position     : chr "panel"
##  $ plot.tag                  :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 1.2
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ plot.tag.position         : chr "topleft"
##  $ plot.margin               : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ strip.background          :List of 5
##   ..$ fill         : chr "grey15"
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ strip.background.x        : NULL
##  $ strip.background.y        : NULL
##  $ strip.clip                : chr "inherit"
##  $ strip.placement           : chr "inside"
##  $ strip.text                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey90"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 4.4points 4.4points 4.4points 4.4points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ strip.text.x              : NULL
##  $ strip.text.y              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ strip.switch.pad.grid     : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ strip.switch.pad.wrap     : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ strip.text.y.left         :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
p <- ggplotly(p)
p
ggplot(iif_issuance_data, aes(fill=issuance_type, y=issuance_bn_usd, x=geography)) + 
    geom_bar(position="stack", stat="identity") + scale_fill_brewer(palette = "Spectral")