PCAF findings

Author

Yuanyuan Liu

PCAF findings on government debt emissions

── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0     ✔ purrr   1.0.1
✔ tibble  3.1.8     ✔ dplyr   1.1.0
✔ tidyr   1.3.0     ✔ stringr 1.5.0
✔ readr   2.1.3     ✔ forcats 1.0.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
library(ggplot2)
library(dplyr)

# Define custom colors for each country
custom_colors <- c("#FFD234", "#2E8B57", "#a8a776", "#FF63b1", "#940167")

# Convert data to long format
financed_emissions_long <- tidyr::gather(financed_emissions, year, value, -Country_Region)

# Calculate total financed emissions for each country
total_financed_emissions <- financed_emissions_long %>%
  group_by(Country_Region) %>%
  summarise(Total_Financed_Emissions = sum(value, na.rm = TRUE)) %>%
  arrange(desc(Total_Financed_Emissions))
# Select top 5 countries
top_5_countries <- total_financed_emissions$Country_Region[1:5]

# Filter data for top 5 countries
financed_emissions_top_5 <- financed_emissions_long %>%
  filter(Country_Region %in% top_5_countries)
# Calculate total financed emissions for each year
total_financed_emissions_year <- financed_emissions_top_5 %>%
  group_by(year) %>%
  summarise(Total_Financed_Emissions_Year = sum(value, na.rm = TRUE))

# Calculate ratio of financed emissions for each country for each year
financed_emissions_top_5_ratio <- financed_emissions_top_5 %>%
  left_join(total_financed_emissions_year, by = "year") %>%
  mutate(Ratio = value / Total_Financed_Emissions_Year)

# Create stacked bar plot with updated legend labels and custom colors
ggplot(financed_emissions_top_5_ratio, aes(x = year, y = Ratio, fill = Country_Region)) +
  geom_bar(stat = "identity", position = "fill") +
  scale_fill_manual(values = custom_colors) +
  theme(legend.position = "bottom", axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(x = "Year", y = "Ratio of financed emissions", fill = "Country/Region")
Warning: Removed 12 rows containing missing values (`position_stack()`).

# Define custom colors for each country
colors <- c("#00a2ff", "#ffaa00", "#8e44ad", "#16a085", "#c0392b")

# Create line chart with custom colors
ggplot(financed_emissions_top_5, aes(x = year, y = value, group = Country_Region, color = Country_Region)) +
  geom_line(size = 1) +
  scale_color_manual(values = colors) +
  theme(legend.position = "bottom", axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  labs(x = "Year", y = "Financed emissions", color = "Country/Region")
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
Warning: Removed 12 rows containing missing values (`geom_line()`).

Based on the line chart of financed emissions data for the top 5 countries, there are a few key findings:

The financed emissions for the United States, India, and Japan have been increasing over time, while Canada’s financed emissions have remained relatively flat.

Brazil also had increasing financed emissions after 2001, and its emissions have been steadily increasing over time, with a more significant increase after the mid-2000s.

The United States has the highest financed emissions among the top 5 countries, and its emissions have been consistently above 4000 throughout the period from 1990 to 2019.

India has the second highest financed emissions among the top 5 countries, and its emissions have been steadily increasing over time, with a more significant increase after the mid-2000s.

Japan’s financed emissions have also been increasing over time, but its rate of increase has slowed down since around 2013.

Canada’s financed emissions have been relatively stable over time, with only slight fluctuations within a range of approximately 2000 to 3000.

Overall, the findings suggest that the United States and India are the top two countries with the highest financed emissions, and that their emissions have been increasing over time. Japan and Brazil have also been increasing their emissions, but at a slower pace in recent years. Canada’s emissions have remained relatively flat. These findings highlight the need for continued efforts to reduce emissions and address climate change, particularly in the top emitting countries.