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.
Problem 1:
indicators_we_want <-c("Green Bond Issuances by Country", "Sovereign Green Bond Issuances")green_debt_subset <- green_debt |>clean_names() |>filter(indicator %in% indicators_we_want) |>mutate(region=countrycode(country, origin="country.name", destination="continent")) |>select(country, iso3, region, indicator, matches("f\\d{4}")) green_debt_subset
# A tibble: 107 × 33
country iso3 region indicator f1985 f1986 f1987 f1990 f1991 f1992 f1993
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Argentina ARG Ameri… Green Bo… NA NA NA NA NA NA NA
2 Australia AUS Ocean… Green Bo… NA NA NA NA NA NA NA
3 Austria AUT Europe Green Bo… NA NA NA NA NA NA NA
4 Austria AUT Europe Sovereig… NA NA NA NA NA NA NA
5 Bangladesh BGD Asia Green Bo… NA NA NA NA NA NA NA
6 Belarus, Re… BLR Europe Green Bo… NA NA NA NA NA NA NA
7 Belarus, Re… BLR Europe Sovereig… NA NA NA NA NA NA NA
8 Belgium BEL Europe Green Bo… NA NA NA NA NA NA NA
9 Belgium BEL Europe Sovereig… NA NA NA NA NA NA NA
10 Bermuda BMU Ameri… Green Bo… NA NA NA NA NA NA NA
# ℹ 97 more rows
# ℹ 22 more variables: 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>, f2016 <dbl>, f2017 <dbl>, f2018 <dbl>, f2019 <dbl>,
# f2020 <dbl>, f2021 <dbl>, f2022 <dbl>
# A tibble: 5 × 2
region cumulative_bn_usd_region
<chr> <dbl>
1 Europe 1391.
2 Asia 582.
3 Americas 339.
4 Oceania 30.4
5 Africa 19.2
green_bd_chart <- biggest_green_bond_region |>ggplot(aes(x = cumulative_bn_usd_region, # order regions by cumulative issuancey =fct_reorder(.f = region, .x = cumulative_bn_usd_region) )) +geom_col(fill ="forestgreen") +theme_minimal() +scale_x_continuous(labels = scales::label_dollar(suffix =" bn"),expand =c(0,0)) +labs(title ="Cumulative Issuance Green Bond by Region",subtitle ="Europian countries do issue a whole lot of green bonds",x ="Cumulative Issuance (USD)",y ="",caption ="Data: IMF Climate Change Dashboard | Insight: Me!")green_bd_chart
Problem 2:
green_debt2 <- green_debt |>clean_names() |>filter(type_of_issuer!="Not Applicable")# Count the number of issuers for each yearissuer_by_year <- green_debt2 |>pivot_longer(cols =matches("f\\d{4}"), names_to ="year",values_to ="issuance_bn_usd",names_transform = readr::parse_number,values_drop_na =TRUE) |>group_by(year) |>summarise(n=n())issuer_by_year
#percentage of bond issued in 2022 x times greater than 2021factoid_2022 <- total_amount_issuance |>filter(year %in%c(2021, 2022)) |>mutate(PercentageIncrease = (TotalIssuance /lag(TotalIssuance)) *100)factoid_2022
# A tibble: 2 × 3
year TotalIssuance PercentageIncrease
<dbl> <dbl> <dbl>
1 2021 653. NA
2 2022 541. 82.8
#percentage of bond issued in 2022 x times greater than 2021factoid_2021 <- total_amount_issuance |>filter(year %in%c(2020, 2021)) |>mutate(PercentageIncrease = (TotalIssuance /lag(TotalIssuance)) *100)factoid_2021
# A tibble: 2 × 3
year TotalIssuance PercentageIncrease
<dbl> <dbl> <dbl>
1 2021 653. NA
2 2020 302. 46.3
Problem 3:
# Count the number of issuers for each use of proceedsissuer_by_use <- green_debt2 |>pivot_longer(cols =matches("f\\d{4}"), names_to ="year",values_to ="issuance_bn_usd",names_transform = readr::parse_number,values_drop_na =TRUE) |>group_by(use_of_proceed) |>summarise(n=n())issuer_by_use
# A tibble: 1 × 2
use_of_proceed n
<chr> <int>
1 Not Applicable 98
#Count the number of issuance in each principal currencyissuer_by_currency <- green_debt2 |>pivot_longer(cols =matches("f\\d{4}"), names_to ="year",values_to ="issuance_bn_usd",names_transform = readr::parse_number,values_drop_na =TRUE) |>group_by(principal_currency) |>summarise(n=n())issuer_by_currency
# A tibble: 1 × 2
principal_currency n
<chr> <int>
1 Not Applicable 98
`summarise()` has grouped output by 'year'. You can override using the
`.groups` argument.
issuer_by_currency_trend
# A tibble: 29 × 3
# Groups: year [29]
year principal_currency n
<dbl> <chr> <int>
1 1985 Not Applicable 2
2 1986 Not Applicable 1
3 1987 Not Applicable 1
4 1990 Not Applicable 1
5 1991 Not Applicable 1
6 1992 Not Applicable 1
7 1993 Not Applicable 2
8 1994 Not Applicable 1
9 1999 Not Applicable 1
10 2000 Not Applicable 2
# ℹ 19 more rows
number_each_year <-c(issuer_by_year$n)ggplot(issuer_by_currency_trend, aes(x = year, y = n/number_each_year*100, group=principal_currency,color=group)) +geom_line(color ="skyblue", size =1) +geom_point(color ="darkblue", size =2) +labs(title ="Currency of Issuance Over Time",x ="Year",y ="percentage of Issuers") +scale_y_continuous(labels = scales::percent_format(scale =1)) +theme_minimal()