Global Carbon Emissions: Which nations are contributing the most to Climate Change?
With the annual reports of anthropogenic climate change being more dire, and that carbon emissions need to be reduced, I found it important to see who was contributing the most and whether those reductions were being met.
Some of the research questions for this project:
Which nations have contributed the most to climate change in terms of CO2 emissions?
What are the factors that have led to such high emission rates?
Which nations, if any, have reduced their emissions?
All of the data for this project was obtained from Our World in Data.
We will be looking at data between 1949 and 2019.
The following are some of the variables:
Country
Year
Total Average Emissions
Trade Emissions
Consumption Emissions
Production Emissions
Emissions Per Capita
The data from OWID begins in 1750 and only contains 223 countries. From 1949 onward, there are 224 countries included in the dataset.In order to have more consistency, the data files were modified to begin in 1949 so all emissions will be counted from there. The dataset also previously accounted for total emissions, but for the purposes of this analysis, the emissions data were modified to account for the average both per year and all-time.
We can see that, overtime, the emissions from South America and Africa has remained relatively the same. North America and Asia’s emissions have continued to climb. Europe was, up until the 1990s, the dominant emitter, but they have since begun to decline and are now only emitting more than South America and Africa. This is a result of the time-frame restrictions, with our observations period only beginning in 1949 and continuing until 2019. Had we started in 1750 and continued until present day, we would likely see Europe being the primary emitter for a longer period of time. It is also likely that Europe’s total average emissions would be closer to, or greater than, Asia’s.
As we progress, it will become apparent that a continent or country being industrialized, or industrializing, is a primary factor in regards to emissions.
Consumption emissions intersect at a point of trade and wealth. The continents that tend to have the highest income(s) and import the most goods, tend to have higher emissions. This is why we see Europe and North America having significantly higher emissions than Africa and Asia, despite having significantly lower populations.
Similar to the Over Time graph, we are seeing how a regions emissions have grown over time. Europe is second to Asia, which appears to be due to the drop in emissions during the 1990s; a drop that has persisted, whereas Asia’s emissions have continued to climb.
Per capita emissions divides the total carbon emitted by a country by the total number of people in said country. The same principle applies here, but for continents. North America and Europe have smaller populations than Africa and Asia, so their per capita emissions are going to be higher, even if one continents total emissions are actually less than the others.
---
title: "CO2 Emissions Dashboard"
author: "Anthony Lapham"
output:
flexdashboard::flex_dashboard:
theme: paper
orientation: columns
social: ["linkedin"]
source_code: embed
---
```{r setup, include=FALSE}
# if R package pacman is not installed, install it first
if(require(pacman) == FALSE) install.packages('pacman')
# load all necessary packages
pacman::p_load(car, tidyverse, magrittr, RColorBrewer, ggsci, ggthemes, scales,
ggplot2, ggrepel,
DataExplorer, DT, conflicted, magick, forcats)
conflict_prefer("filter", "dplyr")
library(flexdashboard) ## you need this package to create dashboard
setwd("C:/Users/lapha/Box/Capstone Lapham/R Code")
```
Introduction
=======================================================================
Column {.tabset data-width=800}
-----------------------------------------------------------------------
### Motivation
Global Carbon Emissions: Which nations are contributing the most to Climate Change?
With the annual reports of anthropogenic climate change being more dire, and that carbon emissions need to be reduced, I found it important to see who was contributing the most and whether those reductions were being met.
Some of the research questions for this project:
1. Which nations have contributed the most to climate change in terms of CO2 emissions?
2. What are the factors that have led to such high emission rates?
3. Which nations, if any, have reduced their emissions?
Column {.tabset data-width=800}
-----------------------------------------------------------------------
All of the data for this project was obtained from [Our World in Data](https://ourworldindata.org/co2-emissions).
We will be looking at data between 1949 and 2019.
### Variables in Dataset
The following are some of the variables:
- Country
- Year
- Total Average Emissions
- Trade Emissions
- Consumption Emissions
- Production Emissions
- Emissions Per Capita
### Modifications in R
The data from OWID begins in 1750 and only contains 223 countries. From 1949 onward, there are 224 countries included in the dataset.In order to have more consistency, the data files were modified to begin in 1949 so all emissions will be counted from there. The dataset also previously accounted for total emissions, but for the purposes of this analysis, the emissions data were modified to account for the average both per year and all-time.
Continental Emissions
=======================================================================
Column {.tabset data-width=500}
----------------------------------------------------------------------
### Over Time
### Average Consumption Emissions
### Consumption Emissions
```{r}
# create a list of the files from your target directory
file_list <- list.files(path="../Data", pattern="adjusted_")
files <- vector("list", length(file_list))
for (i in 1:length(file_list)){
files[[i]] <- read_csv(paste0("../Data/", file_list[i]))
}
df1 <- do.call(rbind.data.frame, files[1])
consumption <- ggplot(data = df1, aes(x = reorder(Entity, +average_co2), y = average_co2)) + geom_bar(fill="blue", stat="identity") + ggtitle("Consumption Emissions (1949-2019)") + xlab("Continent") + ylab("Average Co2 (Tonnes)")
consumption
```
### Regional Emissions
```{r}
df2 <- do.call(rbind.data.frame, files[5])
region <- ggplot(data = df2, aes(x = reorder(Entity, +average_co2), y = average_co2)) + geom_bar(fill="red",stat = "identity") +ggtitle("Emissions by Region (1949-2019)") + xlab("Continent") + ylab("Average Co2 (Tonnes)")
region
```
### Per Capita Emissions
```{r}
co2_file3 <- read.csv("C:\\Users\\lapha\\Box\\Capstone Lapham\\Data\\original data\\co_emissions_per_capita.csv")
names(co2_file3)[names(co2_file3) == "Per.capita.CO2.emissions"] <- "Per.capita"
co2_file3_group <- co2_file3 %>% group_by(Entity, Code) %>% summarise(average_co2 = mean(Per.capita))
co2_file3_group <- co2_file3_group %>% filter(Entity == "Asia"|Entity == "Europe"|Entity == "Africa"|Entity == "North America"|Entity =="South America")
perCapita <- ggplot(data = co2_file3_group, aes(x = reorder(Entity, +average_co2), y = average_co2)) + geom_bar(fill = "green",stat="identity") + xlab("Continent") + ggtitle("Per Capita Emissions (1949-2019)") + ylab("Average Co2 (Tonnes)")
perCapita
```
Column {.tabset data-wdith=500}
----------------------------------------------------------------------
### Observations
We can see that, overtime, the emissions from South America and Africa has remained relatively the same. North America and Asia's emissions have continued to climb. Europe was, up until the 1990s, the dominant emitter, but they have since begun to decline and are now only emitting more than South America and Africa. This is a result of the time-frame restrictions, with our observations period only beginning in 1949 and continuing until 2019. Had we started in 1750 and continued until present day, we would likely see Europe being the primary emitter for a longer period of time. It is also likely that Europe's total average emissions would be closer to, or greater than, Asia's.
As we progress, it will become apparent that a continent or country being industrialized, or industrializing, is a primary factor in regards to emissions.
Consumption emissions intersect at a point of trade and wealth. The continents that tend to have the highest income(s) and import the most goods, tend to have higher emissions. This is why we see Europe and North America having significantly higher emissions than Africa and Asia, despite having significantly lower populations.
Similar to the Over Time graph, we are seeing how a regions emissions have grown over time. Europe is second to Asia, which appears to be due to the drop in emissions during the 1990s; a drop that has persisted, whereas Asia's emissions have continued to climb.
Per capita emissions divides the total carbon emitted by a country by the total number of people in said country. The same principle applies here, but for continents. North America and Europe have smaller populations than Africa and Asia, so their per capita emissions are going to be higher, even if one continents total emissions are actually less than the others.
Average Co2 by Consumption
============================================================================
Average Co2 Emissions Per Capita
=======================================================================
Trade Emissions
======================================================================
Average Co2 Emissions Per Country
=======================================================================
About the Author
===============================================
Column {data-width=650}
---------------------------------------------------
### Personal Background
Hello, my name is Anthony Lapham. I am an undegraduate student at the University of Dayton with an expected graduation date of December 2021.
This dashboard is for my mathematics capstone project, under the supervision of Dr. Ying-Ju Tessa Chen.
DEGREE IN PROGRESS:
- B.S. in Mathematics with a Minor in Computer Science
I am looking to pursue a career in software development. I have experience coding in Java, JS, and R.
Connect with me on [LinkedIn](https://www.linkedin.com/in/anthonylapham/){target="_blank"}!
Column {data-width=150}
-----------------------------------------------------
### Photo
```{r, echo=FALSE, fig.cap="Anthony Lapham", out.width = '100%'}
knitr::include_graphics("C:\\Users\\lapha\\Pictures\\r photo.jpg")
```