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() |>filter(indicator %in% indicators_we_want) |>select(country, iso3, indicator, matches("f\\d{4}")) green_debt_subset$region <-countrycode(green_debt_subset$iso3, "iso3c", "region")green_bonds_tidy <- green_debt_subset |>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_bonds_cumulative <- green_bonds_tidy |>select(-iso3) |>arrange(region) |>group_by(region) |>mutate(cumulative_bn_usd =cumsum(issuance_bn_usd)) |>slice_max(order_by = cumulative_bn_usd) |>arrange(cumulative_bn_usd|>desc()) |>select(region, cumulative_bn_usd) |>ungroup()green_bonds_cumulative |>ggplot(aes(x = cumulative_bn_usd, y =fct_reorder(.f = region, .x = cumulative_bn_usd) )) +geom_col(fill ="maroon") +theme_minimal() +scale_x_continuous(labels = scales::label_dollar(suffix =" bn"),expand =c(0,0)) +labs(title ="Cumulative Issuance of Green Bonds by Region",subtitle ="Europe and Central Asia are responsible for the highest green bond issuance",x ="Cumulative Issuance (USD)",y ="Region",caption ="Data: IMF Climate Change Dashboard | Insight: Pinandito Wisambudi")
Homework 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.