Project Part 2

Interactive and static plots of per capita CO2 emissions from 1950 to 2020.

  1. Packages I will use to read in and plot the data.
  1. Read the data in from part 1.
country_co2  <- read_csv(here::here("country_co2.csv"))

Interactive Graph

country_co2   %>%
  group_by(Country)  %>%
  mutate(CO2emissions = round(CO2emissions, 2),
         Year = paste(Year, "12", "31", sep="-"))  %>% 
  e_charts(x = Year)   %>% 
  e_river(serie = CO2emissions, legend=FALSE)  %>% 
  e_tooltip(trigger = "axis")  %>% 
  e_title(text = "Per Capita CO2 emissions, by Country",
          subtext = "(in billions of tonnes). Source: Our World in Data",
          sublink = "https://ourworldindata.org/explorers/co2?facet=none&country=CHN~USA~IND~GBR~OWID_WRL~AFG~Africa~ALB~ZWE~ZMB~YEM~WLF~VNM~VEN~VUT~UZB~URY~Upper-middle-income+countries~ARE~UKR~UGA~TUV~TCA~TKM~TUR~TUN~TTO~TON~TGO~TLS~THA~TZA~TJK~TWN~SYR~CHE~SWE~SDN~LKA&Gas=CO%E2%82%82&Accounting=Production-based&Fuel=Total&Count=Per+capita",
          left = "center")  %>% 
  e_theme("royal") 

Static Graph

country_co2   %>% 
  ggplot(aes(x = Year, y = CO2emissions, 
             fill = Country)) +
  geom_area() +
  colorspace::scale_fill_discrete_divergingx(palette = "roma", nmax =11) +
  theme_classic() +
  theme(legend.position = "bottom") +
  labs( y = "in billions of tonnes",
       fill = NULL)

ggsave(filename = here::here("_posts/2022-05-17-project-part-2/preview.png"))

These plots show a comparison of per capita CO2 emissions by some of the top countries contributing to climate change, as well as an overall increase in emissions in every country. The range of data is from 1950 to 2020.