Rows: 355 Columns: 42
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (12): Country, ISO2, ISO3, Indicator, Unit, Source, CTS_Code, CTS_Name, ...
dbl (30): ObjectId, F1985, F1986, F1987, F1990, F1991, F1992, F1993, F1994, ...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
green_debt
# A tibble: 355 × 42
ObjectId Country ISO2 ISO3 Indicator Unit Source CTS_Code CTS_Name
<dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 1 Argentina AR ARG Green Bo… Bill… Refin… ECFFI Green B…
2 2 Australia AU AUS Green Bo… Bill… Refin… ECFFI Green B…
3 3 Austria AT AUT Green Bo… Bill… Refin… ECFFI Green B…
4 4 Austria AT AUT Sovereig… Bill… Refin… ECFF Green B…
5 5 Bangladesh BD BGD Green Bo… Bill… Refin… ECFFI Green B…
6 6 Belarus, Rep. … BY BLR Green Bo… Bill… Refin… ECFFI Green B…
7 7 Belarus, Rep. … BY BLR Sovereig… Bill… Refin… ECFF Green B…
8 8 Belgium BE BEL Green Bo… Bill… Refin… ECFFI Green B…
9 9 Belgium BE BEL Sovereig… Bill… Refin… ECFF Green B…
10 10 Bermuda BM BMU Green Bo… Bill… Refin… ECFFI Green B…
# ℹ 345 more rows
# ℹ 33 more variables: CTS_Full_Descriptor <chr>, Type_of_Issuer <chr>,
# Use_of_Proceed <chr>, Principal_Currency <chr>, F1985 <dbl>, F1986 <dbl>,
# F1987 <dbl>, F1990 <dbl>, F1991 <dbl>, F1992 <dbl>, F1993 <dbl>,
# F1994 <dbl>, F1999 <dbl>, F2000 <dbl>, F2002 <dbl>, F2003 <dbl>,
# F2004 <dbl>, F2007 <dbl>, F2008 <dbl>, F2009 <dbl>, F2010 <dbl>,
# F2011 <dbl>, F2012 <dbl>, F2013 <dbl>, F2014 <dbl>, F2015 <dbl>, …
# we want to compare these two indicatorsindicators_we_want <-c("Green Bond Issuances by Country", "Sovereign Green Bond Issuances")green_debt_subset <- green_debt |># from the janitor package -- makes variables snake_case so they are easier to work withclean_names() |># filter for the vector of indicators we defined abovefilter(indicator %in% indicators_we_want) |># "f\\d{4}" is a regular expression (regex) that searches for all columns that are f + four digits.# Ask ChatGPT to explain this to you.select(country, iso3, indicator, matches("f\\d{4}")) green_debt_subset
# A tibble: 107 × 32
country iso3 indicator f1985 f1986 f1987 f1990 f1991 f1992 f1993 f1994 f1999
<chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Argent… ARG Green Bo… NA NA NA NA NA NA NA NA NA
2 Austra… AUS Green Bo… NA NA NA NA NA NA NA NA NA
3 Austria AUT Green Bo… NA NA NA NA NA NA NA NA NA
4 Austria AUT Sovereig… NA NA NA NA NA NA NA NA NA
5 Bangla… BGD Green Bo… NA NA NA NA NA NA NA NA NA
6 Belaru… BLR Green Bo… NA NA NA NA NA NA NA NA NA
7 Belaru… BLR Sovereig… NA NA NA NA NA NA NA NA NA
8 Belgium BEL Green Bo… NA NA NA NA NA NA NA NA NA
9 Belgium BEL Sovereig… NA NA NA NA NA NA NA NA NA
10 Bermuda BMU Green Bo… NA NA NA NA NA NA NA NA NA
# ℹ 97 more rows
# ℹ 20 more variables: f2000 <dbl>, f2002 <dbl>, f2003 <dbl>, f2004 <dbl>,
# f2007 <dbl>, f2008 <dbl>, f2009 <dbl>, f2010 <dbl>, f2011 <dbl>,
# f2012 <dbl>, f2013 <dbl>, f2014 <dbl>, f2015 <dbl>, f2016 <dbl>,
# f2017 <dbl>, f2018 <dbl>, f2019 <dbl>, f2020 <dbl>, f2021 <dbl>,
# f2022 <dbl>
Warning: There was 1 warning in `summarise()`.
ℹ In argument: `across(where(is.numeric), sum, na.rm = TRUE)`.
ℹ In group 1: `region = "East Asia & Pacific"`.
Caused by warning:
! The `...` argument of `across()` is deprecated as of dplyr 1.1.0.
Supply arguments directly to `.fns` through an anonymous function instead.
# Previously
across(a:b, mean, na.rm = TRUE)
# Now
across(a:b, \(x) mean(x, na.rm = TRUE))
# A tibble: 7 × 2
type_of_issuer total_issuance
<chr> <dbl>
1 Banks 444.
2 International Organization 188.
3 Local and state Government 39.3
4 Nonfinancial corporations 659.
5 Other financial corporations 408.
6 Sovereign 266.
7 State owned entities 282.
ggplot(green_debt_filtered_summarized_TOI, aes(x=reorder(type_of_issuer, total_issuance), y=total_issuance, fill=type_of_issuer)) +geom_bar(stat="identity") +theme_minimal() +labs(title="Total Green Bond Issuances by Issuer Type", x="Issuer Type", y="Total Issuance") +coord_flip()
# A tibble: 69 × 2
use_of_proceed total_issuance
<chr> <dbl>
1 Access to Essential Services 12.8
2 Acquiring and distribution of vaccine 0.400
3 Acquisition 7.40
4 Affordable Basic Infrastructure 0.0428
5 Agriculture 0.503
6 Alternative Energy 25.7
7 Aquatic Biodiversity Conservation 75.7
8 Capital expenditure 1.50
9 Capital expenditure/Financing expenses 1.81
10 Carbon reduction through reforestation and avoided deforestat… 4.98
# ℹ 59 more rows
ggplot(green_debt_filtered_summarized_UOP, aes(x=reorder(use_of_proceed, total_issuance), y=total_issuance, fill=use_of_proceed)) +geom_bar(stat="identity") +theme_minimal() +labs(title="Total Green Bond Issuances by Use of Proceed", x="Use of Proceed", y="Total Issuance") +coord_flip()
# A tibble: 50 × 2
principal_currency total_issuance
<chr> <dbl>
1 Argentinian Peso 0.0240
2 Argentinian Unidades de Valor Adquisitivo 0
3 Australian Dollar 27.8
4 Bangladeshi Taka 0.387
5 Brazilian Real 4.89
6 British Pound 73.3
7 Canadian Dollar 53.1
8 Chilean Peso 0.0311
9 Chilean Unidad de Fomento 0.215
10 Chinese Yuan 326.
# ℹ 40 more rows
ggplot(green_debt_filtered_summarized_PC, aes(x=reorder(principal_currency, total_issuance), y=total_issuance, fill=principal_currency)) +geom_bar(stat="identity") +theme_minimal() +labs(title="Total Green Bond Issuances by Use of Proceed", x="Use of Proceed", y="Total Issuance") +coord_flip()