Duke University
This vignette introduces the data that alerted us to the rapid CO2 increases in the atmosphere. Charles Keeling began monitoring atmospheric CO2 from atop Mauna Loa in 1958. The site was selected to be remote from local variations, aiming to provide a global perspective. It came to represent one of the most immediate and persuasive arguments that change is happening fast. The Mauna Loa CO2 data will provide an opportunity to work directly with the data that have been in media on climate change and its consequences.
Get started with R: work through the intro to R here
CO2 data from Mauna Loa trace buildup of greenhouse gasses. Work through this vignette and stop when you get to the section The Law Dome Ice Core Record (longer term trends that we’ll pick up on later).
Here is some simplified code for first steps here. This block of R code will extract long-term CO2 concentrations at the Mauna Loa observatory from the NOAA ftp site:
mw <- read.table('ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_weekly_mlo.txt')
# select columns and assign new names
mw <- mw[, c(1, 2, 3, 5)]
names(mw) <- c('year', 'month', 'day', 'co2ppm')
head(mw)
# date format
mw$date <- as.Date(paste(mw$year, mw$month, mw$day, sep = '-'),
format = '%Y-%m-%d')
# only necessary columns
mw <- mw[, c('date', 'co2ppm')]
# missing values
mw[mw$co2ppm == -999.99, ]$co2ppm = NA
head(mw)
Make a plot:
par( bty = 'n' )
plot(mw$date, mw$co2ppm, type = 'l',
xlab = 'Year', ylab = 'CO2 Concentration (ppmV)',
main = 'Mauna Loa Weekly Carbon Dioxide Concentration'
)