Visualizing Carbon Dioxide Levels

Climate scientists have measured the concentration of carbon dioxide (CO2) in the Earth’s atmosphere dating back thousands of years. Here I have explored increase in carbon dioxide levels over the past hundred years relative to the variability in levels of CO2 in the atmosphere over eight millennia.

Carbon dioxide hits a level not seen for 3 million years.

Carbon dioxide hits a level not seen for 3 million years.

These data are calculated by analyzing ice cores. Over time, gas gets trapped in the ice of Antarctica. Scientists can take samples of that ice and see how much carbon is in it. The deeper you go into the ice, the farther back in time you can analyze!

Datasets

# loading libraries and data
library(readr)
library(dplyr)
library(ggplot2)
library(knitr)
noaa_data <- read_csv ("carbon_dioxide_levels.csv")
head(noaa_data) %>% 
  kable()
Age_yrBP CO2_ppmv
137 280.4
268 274.9
279 277.9
395 279.1
404 281.9
485 277.7
World Data Center for Paleoclimatology

World Data Center for Paleoclimatology

Carbon Dioxide over Time Line Graph

Years before present, which is “a time scale used mainly in … scientific disciplines to specify when events occurred in the past… standard practice is to use 1 January 1950 as the commencement date of the age scale, reflecting the origin of practical radiocarbon dating in the 1950s. The abbreviation “BP” has alternatively been interpreted as “Before Physics” that is, before nuclear weapons testing artificially altered the proportion of the carbon isotopes in the atmosphere, making dating after that time likely to be unreliable.” This means that saying “the year 20 BP” would be the equivalent of saying “The year 1930.”

options(scipen=10000) #removes scientific notation
#NOAA Visualization:
noaa_viz <- ggplot(data = noaa_data, aes(x = Age_yrBP, y = CO2_ppmv)) + 
            geom_line() + 
            scale_x_reverse(lim = c(800000,0)) +
            labs(title = "Carbon Dioxide Levels From 8,000 to 136 Years BP", subtitle = "From World Data Center for Paleoclimatology and NOAA Paleoclimatology Program", x = "Years Before Today (0=1950)", y = "Carbon Dioxide Level (Parts Per Million)")
noaa_viz

Carbon Dioxide Levels in the last Two Millennia

In the second block, I explored the second dataset containing the data for the last 2014 years.

#IAC Visualization
iac_data <- read_csv ("yearly_co2.csv")
head(iac_data) %>%
  kable()
year data_mean_global data_mean_nh data_mean_sh
0 277.454 277.454 277.454
1 277.137 277.137 277.137
2 277.160 277.160 277.160
3 277.158 277.158 277.158
4 277.157 277.157 277.157
5 277.167 277.167 277.167
iac_viz <- ggplot(data = iac_data, aes(x=year, y = data_mean_global)) +
           geom_line() +
           labs(title = "Carbon Dioxide Levels over Time",subtitle = "From Institute for Atmospheric and Climate Science (IAC).", x= "Year", y= "Carbon Dioxide Level (Parts Per Million)")
iac_viz

Now here I highlighted the rise in carbon dioxide levels by adding a horizontal line that represents the maximum level in the first chart spanning over 8,000 years of carbon dioxide data.

millenia_max <- max(noaa_data $ CO2_ppmv)
print(millenia_max)
## [1] 298.6
iac_viz <- iac_viz +
           geom_hline(aes(yintercept=millenia_max, linetype = "Historical CO2 Peak before 1950"))
iac_viz


  1. Author github: Emon-ProCoder7 2. Author Linked-in:Md Tabassum Hossain Emon