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.
indicators_we_want <-c("Green Bond Issuances by Country", "Sovereign Green Bond Issuances")green_debt_subset <- green_debt |>clean_names() |>mutate(region =countrycode(iso2, "iso2c", "region"), .before = iso2) green_debt_subset
# A tibble: 355 × 43
object_id country region iso2 iso3 indicator unit source cts_code cts_name
<dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 1 Argent… Latin… AR ARG Green Bo… Bill… Refin… ECFFI Green B…
2 2 Austra… East … AU AUS Green Bo… Bill… Refin… ECFFI Green B…
3 3 Austria Europ… AT AUT Green Bo… Bill… Refin… ECFFI Green B…
4 4 Austria Europ… AT AUT Sovereig… Bill… Refin… ECFF Green B…
5 5 Bangla… South… BD BGD Green Bo… Bill… Refin… ECFFI Green B…
6 6 Belaru… Europ… BY BLR Green Bo… Bill… Refin… ECFFI Green B…
7 7 Belaru… Europ… BY BLR Sovereig… Bill… Refin… ECFF Green B…
8 8 Belgium Europ… BE BEL Green Bo… Bill… Refin… ECFFI Green B…
9 9 Belgium Europ… BE BEL Sovereig… Bill… Refin… ECFF Green B…
10 10 Bermuda North… 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>, …
# A tibble: 7 × 2
region cumulative_issuance
<chr> <dbl>
1 East Asia & Pacific 586.
2 Europe & Central Asia 1395.
3 Latin America & Caribbean 99.8
4 Middle East & North Africa 10.3
5 North America 239.
6 South Asia 15.0
7 Sub-Saharan Africa 16.2
# A tibble: 7 × 2
region cumulative_issuance
<chr> <dbl>
1 Europe & Central Asia 1395.
2 East Asia & Pacific 586.
3 North America 239.
4 Latin America & Caribbean 99.8
5 Sub-Saharan Africa 16.2
6 South Asia 15.0
7 Middle East & North Africa 10.3
regional_cumulative_issuance <-ggplot(green_bond_region, aes(x = cumulative_issuance, y =reorder(region, cumulative_issuance))) +geom_col(fill ="forestgreen") +theme_minimal() +scale_x_continuous(labels = scales::label_dollar(suffix =" BN"), expand =c(0, 0)) +labs(x ="Cumulative Issuance", y ="Region", title ="Regional Cumulative Issuance of Green Bonds")regional_cumulative_issuance
Problem 2:
Use the full green_debt dataset
Use clean_names() to make the variable names snake_case
Filter out observations where type_of_issuer is “Not Applicable”
Use the tools taught in this chapter to provide a compelling data visualization and some repeatable factoids that provide actionable insights about green bond issuers.
data visualization
green_debt_issuer <- green_debt |>clean_names() |>filter(type_of_issuer !="Not Applicable")green_debt_issuer <- green_debt_issuer |>pivot_longer(cols =matches("f\\d{4}"),names_to ="Year", values_to ="Issuance_bn_usd",names_transform = readr::parse_number,values_drop_na =TRUE )green_debt_issuer|>filter(Year>=2010)|>ggplot(aes(x = Year, y = Issuance_bn_usd, fill = type_of_issuer)) +geom_bar(stat ="identity", position ="stack") +labs(title ="Green bond Issuance By Type of Issuers After Year 2010", x ="Year", y ="Green Bond Insurance in $BN" ) +theme_minimal() +theme(legend.position ="right")