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.
Homework Problem 1
Add the region as a variable to green_debt_subset
Calculate the cumulative issuance of green bonds by region;data visualization comparing regional cumulative issuance
green_debt <- green_debt |>clean_names() |>mutate(region =countrycode(iso2, "iso2c", "continent"), .before = iso2)green_debt_cumulate <- green_debt |>pivot_longer(cols =matches("f\\d{4}"),names_to ="fiscal_year", values_to ="issuance_bn_usd",values_drop_na =TRUE )|>filter(!is.na(region))|>group_by(region) |>summarize(cumulative_issuance =sum(issuance_bn_usd)) |>ungroup()ggplot(green_debt_cumulate, aes(x = region, y = cumulative_issuance, fill = region)) +geom_text(aes(label =sprintf("%.2f", cumulative_issuance), vjust =-0.5)) +geom_col() +labs(title ="Cumulative issuance of green bonds by region", x ="Region", y ="Issurance of green bonds(Billions of USD)" ) +theme(plot.title =element_text(face ="bold"))
Homework Problem 2
Use clean_names to make the variable names snake_case
Filter out observations where type_of_issuer is “Not Applicable”
Use the tools to provide actionable insights about green bond issuers.
Green bond issuance by difference type of issuers from 2010-2022
green_debt_toi|>filter(fiscal_year>=2010)|>ggplot(aes(x = fiscal_year, y = issuance_bn_usd, fill = type_of_issuer)) +geom_col() +labs(title ="Green bond issuance by difference type of issuers from 2010-2022", x ="Year", y ="Issurance of green bonds(Billions of USD)" ) +theme(plot.title =element_text(face ="bold"), axis.text.x =element_text(angle =30, hjust =1))
Cumulative issuance of green bonds by type of issue
green_debt_toi_cumulate <- green_debt_toi|>group_by(type_of_issuer) |>summarize(cumulative_issuance =sum(issuance_bn_usd)) |>ungroup()ggplot(green_debt_toi_cumulate, aes(x = type_of_issuer, y = cumulative_issuance, fill = type_of_issuer)) +geom_text(aes(label =sprintf("%.2f", cumulative_issuance), vjust =-0.5)) +geom_col() +labs(title ="Cumulative issuance of green bonds by type of issuer", x ="Type of issuer", y ="Issurance of green bonds(Billions of USD)" ) +theme(plot.title =element_text(face ="bold"), axis.text.x =element_text(angle =30, hjust =1))
Homework Problem 3
Repeat the process from problem 2 for use_of_proceed and for principal_currency
There are 50 currency used in the green bond issuance in fiscal year 2022. Before 2022, there has not been any green bonds issuance, so the change overtime cannot be measured.