1 Instructions

This lab is in two parts: * PartI focuses on modern global temperature and atmospheric CO2 * PartII focuses on the Ice Core record with geologic history of temperature and CO2. PartII also includes the modern $$13C atmospheric record for additional evidence of anthropogenic climate change.

1.1 Setup

  • create a folder EcosystemEcology/Lab2 on your computer
  • download Lab2_AllData.xlsx and the .Rmd file to this folder!
  • Use 'save as' to save the file with a new name to create your own .Rmd and add your answers:
    • save as: Lab2_Assignment_partI_LASTnameFIRSTname.Rmd and .html

1.2 Doing the lab

  • read through this assignment sheet so you know what the lab involves
  • choose whether you want to do the assignment with or without helper code
  • load data into R
  • Answer questions showing:
    • code
    • inserting supporting figures
    • provide explanations
  • for maximum points, answer in full sentences using appropriate units, figure axis labels, and descriptive figure titles
  • submit as .html (zipped if getting security error) and as .Rmd file in Blackboard
  • IMPORTANT: when you open the Rmd file in the first code chunk called {r setup, include = FALSE} change the settings to echo = TRUE and eval = TRUE to make sure your output shows. It needs to look like this:

knitr::opts_chunk$set(echo= TRUE, eval= TRUE)

1.3 DUE

  • part I: September 9
  • part II: September 13

1.4 Background Questions

Read the Lab2 Description to answer these questions:

  1. Why does the rate of temperature change matter?
  2. What is the warming threshold aboe which the IPCC warns there will be catastrophic climate change?
  3. What region/latitudes of the Earth are warming most rapidly?
  4. Why is Mauna Loa a good place to measure atmospheric CO2?
  5. Have you heard of isotopes before?
  6. Why is the ice record useful for understanding climate change?
  7. What does a negative temperature anomaly tell you about the global temperature?

2 Lab Outline

  1. Activity A: Determine current rates of air temperature and CO2 change from modern datasets
  2. Activity B: Explore whether modern temperature and CO2 concentrations are related
  3. Activity C: Compare current and pre-historical temperature and CO2 concentrations using data from the Vostok ice core
  4. Activity D: Use modern atmospheric isotopic \(\delta\) 13C data to examine supporting evidence that the current rise in CO2 comes from fossil fuel emissions

3 The Datasets:

  1. Modern Global Temperature means and anomalies
  2. Atmospheric CO2 concentrations from Mauna Loa
  3. Atmospheric \(\delta\) 13C signatures from Mauna Loa
  4. Vostok Ice Core geologic record of global temperature and CO2 concentration

4 Load libraries and import data to R

4.1 Load required libraries

library(dplyr)
library(ggplot2)
library(readxl) # use install.packages("readxl") or install manually in Packages tab

4.2 Confirm your working directory

The first step for opening data in R is to tell R which folder on your computer contains the data. The folder that R reads is called 'the working directory' or wd. You can use the command getwd() to find out which folder R is currently looking at.
It will be easiest if you save the data and your .Rmd in the same folder because the default wd is the directory that your R script file comes from. If the data and .Rmd are in the same place, you won't need to change anything.

Confirm that your wd is the folder where your data is saved:

4.3 Import the data

OK, ready to import data.
Read the data from the excel sheet by specifying which sheet and which line the data starts on.
We're going to load all the data for the entire assignment in this step. I like to set-up my code this way, so that I can see all the data I plan to use by looking at the beginning of my R script. Each dataframe that we create should show up in your environment.

setwd("/Users/memauritz/Desktop/R/R_programs/Teaching/EcosystemEcology_UTEP/Lab2_Data")

modern.temp <- read_excel("Lab2_AllData.xlsx", sheet="GlobalTemperatureData_1880_2014", skip=2)
modern.temp.anomaly <- read_excel("Lab2_AllData.xlsx", sheet="GlobalTempAnomaly_1880_2019", skip=1)
modern.co2 <- read_excel("Lab2_AllData.xlsx", sheet="MaunaLoa_AnnualMean_CO2", skip=56)

4.4 Do a simple check to see whether the data imported correctly

Use %>% glimpse to see the column names and the column type.
All of our data is numeric so all the column types should be < dbl >.
You can also check this in the excel file to see how R reads data.

Modern Temperature data set:

## Rows: 135
## Columns: 2
## $ Year          <dbl> 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1…
## $ Temperature_F <dbl> 56.822, 56.966, 56.912, 56.858, 56.714, 56.750, 56.768,…

Modern Temperature anomaly data set:

## Rows: 140
## Columns: 3
## $ Year               <dbl> 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 18…
## $ Temp_anom_C        <dbl> -0.16, -0.07, -0.10, -0.16, -0.28, -0.32, -0.30, -…
## $ Temp_anom_C_smooth <dbl> -0.08, -0.12, -0.16, -0.19, -0.23, -0.25, -0.26, -…

Modern CO2 concentration data set:

## Rows: 61
## Columns: 3
## $ Year            <dbl> 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967,…
## $ Mean_co2        <dbl> 315.97, 316.91, 317.64, 318.45, 318.99, 319.62, 320.0…
## $ Uncertainty_co2 <dbl> 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12,…

5 An easy way to see column names

When trying to remember the names of columns to graph or analyse your data, you can use colnames(data) anytime for a quick reminder of what's in a data frame. Eg:

colnames(modern.temp)
## [1] "Year"          "Temperature_F"

6 Question Set

6.1 Activity A:

Determine current rates of air temperature and CO2 change from modern datasets

6.1.1 Examine the absolute temperature record from 1880 - 2014:

  1. In modern.temp, the temperature column is called Temperature_F to indicate that temperature is reported in Fahrenheit. Use mutate() and the F to C conversion to calculate Celsius. We'll use Celsius because it is a scientific unit:

\(Temperature(C) = (Temperature(F) - 32) * \frac{5}{9}\)

  1. Create a graph showing the change in global temperature from 1880 to 2014. Add the data using geom_point() and geom_line():

6.1.2 What is the rate of temperature change from 1880 to 2014, in Celsius?

The rate of change is represented by the slope of a linear line fit. Recall the equation of a linear line:
\(y = mx + b\)

Where y is the data on the y-axis, x is the data on the x-axis, m is the slope of the relationship, and b describes the intercept. Remember, the intercept will be in the units of the y-variable and the slope will be in units y/units x (ie: Celsius/year).

The R function that fits a straight line is lm(y ~ x, data)

Answer the following:
a. What is the equation of the line? b. What is the rate of temperature change (with units)? (hint: don't forget time in the units)

Fit a linear line to the temperature change over year 1880 to 2014:

Display the result of the linear fit to find the value of the slope. One way to do this is by simply calling the object you just created with the line fit:

The output will show you the formula that was used to predict the line, and it will tell you the (Intercept) and slope. In R the slope is always given the name of the x-variable, in this case Year.

6.1.3 Plot the rate of change line on top of the graph from part 6.1.1.

Answer the following:
a. Based on the equation, and the figure, what would you conclude about global temperature change since 1880?

  1. The slope tells you the rate of change in y per 1 unit of x. Knowing that, use the slope to calculate how many degrees the temperature changed from 1880 to 2014? Show your code or write out your math.

Plot the rate of change with the information from the lm() output (you can round to 3 significant figures) and add + geom_abline(intercept = , slope= ) to your ggplot.

R can also do simple math, eg:

1+2
## [1] 3

And:

2*7
## [1] 14

6.1.4 What is the warming trend since 1950?

The warming trend we see today is considered to have accelerated from the mid 1900's when the globalisation we recognise today started to grow. Calculate a new temperature trend-line that starts in 1950. You can do this by using filter to create a new dataset that starts in 1950, and fit a line.
Answer the following:
a. What is the equation of the line?

  1. What is the rate of temperature change since 1950 (with units)? (hint: don't forget time in the units)

  2. Compare the rate of change between 1880-2014 and 1950-2014.

  3. Do you have any concerns about the approach of graphing a straight line fit to the data from 1880-2014?

Calculating rate of change since 1950:

6.1.5 Make a figure with the anomaly data that extends to 2019, the most up-to-date annual data

NASA GISS uses a baseline period from 1951-1980.

Do the following:
a. graph the column Temp_anom_C in modern.temp.anomaly

  1. add accurate titles and axis labels

  2. add +geom_hline(yintercept=0, colour="grey") as a 0 reference to make it easier to distinguish negative and positive anomalies.

  3. add +geom_segment(aes(x=1951, xend=1980, y=0, yend=0), colour="red") to show the baseline period in your plot.

Answer the following:
e. How many degrees did the temperature change from the baseline year to 2019?

  1. How does this most recent change compare to the temperature change you calculated from 1880-2014 in part 6.1.2?

Graph of modern temperature anomalies:

6.2 Activity B:

Explore whether modern temperature and CO2 concentrations are related

6.2.1 Plot a graph of modern CO2 vs time

The data is in modern.co2, and we will use the Mean_co2 column which is the average annual atmospheric CO2 concentration in ppm.

Answer/do the following:
a. Graph the change in modern CO2 concentrations measured at Mauna Loa from 1950-2019

  1. What is the equation of the line?

  2. What is the rate of CO2 change since 1950 (with units)? (hint: don't forget time in the units)

Calculate the rate of change:

6.2.2 Make a graph to show the relationship between temperature anomalies and atmospheric CO2 concentration.

To do this, merge the temperature anomaly with the modern co2 data by Year. You can use the merge() or dplyr inner_join() functions.

Answer the following:
a. What is the relationship between atmospheric CO2 and the global temperature anomaly?

  1. Based on this relationship, what was the atmospheric CO2 concentration threshold when temperatures began to increase? Explain your answer.

  2. What would you conclude about the relationship between global mean temperature and atmospheric CO2?