knitr::opts_knit$set(root.dir = "//Users//abbey//Desktop//thesis//data//REPORT//data_summary")
library(ggplot2)
library(dplyr)  
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(knitr)
library(rmarkdown)

3. respiration (Rs)

questions: How does experimental treatment (snow cover / current conditions) impact leaf litter microbial Rs? How does Rs change as moisture is held constant and temperature varies? How does Rs change as temperature is held constant and moisture varies?

_ experiment #1: Δ temperature_

experimental setup - leaves were hydrated to full water / field capacity (leaves harvested from field, removed from litter bags, placed into a container with di water, soaked for 10 minutes, removed and dried on paper towels for 2 min, excess water removed through patting dry)

for each treatment (n=3 litter bags harvested), hydrated leaves (9 leaves total, 3 leaves x 3 bags) were then stacked and placed in a plastic bag to be frozen overnight

temperature gradient was defined as the frozen leaf temperature warming up to room temperature (about 2-3°C on the low end to 20.5°C on the high end)

the change in temperature experiment looked to compare Rs rates of leaf litter from SC and CC treatments. both treatments were seperately run, and the temperature range was defined throughout the course of leaf litter warming up to room temperature

two data sets are included here: 1. (10.03.20 date of record) - this first describes a smaller difference in leaf water content between the two treatments + current conditions (water content = 69.6%), snow cover (water content = 77.7%), difference = 8.1% water content + goal is to minimize the difference in water content between the two treatments - control for moisture

gleaning data:

ten_SC_deltaT <- read.csv("10.03_SC_deltaT.csv")
ten_CC_deltaT <- read.csv("10.03_CC_deltaT.csv")

merging two dataframes, defining by treatment type (for 10.03.20 measurement)

ten_CC_deltaT$treatment <- "CC"
ten_SC_deltaT$treatment <- "SC"

ten_deltaT <- rbind(ten_CC_deltaT, ten_SC_deltaT)

plot two curves on one graph (for 10.03.20 measurememt)

ten_deltaT <- ggplot(ten_deltaT, aes(x = Tsoil_C, y = Rs, color = treatment))+
  geom_point()+
  
  labs(x="temperature °C", 
       y="Rs (ug CO[2] g dry mass leaf litter ^-1 s^-1",
       title="Scatterplot of leaf litter respiration by treatment as temperature increases",
       subtitle="difference = 8.1% water content between treatments")+
   geom_smooth(method=lm, aes(fill=treatment))
ten_deltaT

  1. (07.03.20 date of record)- the second describes a slightly larger difference in leaf water content between the two treatments
  • current conditions (water content = 67.1%), snow cover (water content = 76.8%), difference = 9.8% water content
  • this is a larger differnce in water content than the 10.03.20 date of record above
seven_SC_deltaT <- read.csv("07.03_SC_deltaT.csv")
seven_CC_deltaT <- read.csv("07.03_CC_deltaT.csv")

merging two dataframes, defining by treatment type (for 07.03.20 measurememt)

seven_CC_deltaT$treatment <- "CC"
seven_SC_deltaT$treatment <- "SC"

seven_deltaT <- rbind(seven_CC_deltaT, seven_SC_deltaT)

plot two curves on one graph (for 07.03.20 measurememt)

seven_deltaT <- ggplot(seven_deltaT, aes(x = Tsoil_C, y = Rs, color = treatment))+
  geom_point()+
  
  labs(x="temperature °C", 
       y="Rs (ug CO[2] g dry mass leaf litter ^-1 s^-1",
       title="Scatterplot of leaf litter respiration by treatment as temperature increases",
       subtitle="difference = 9.8% water content between treatments")+
   geom_smooth(method=lm, aes(fill=treatment))
seven_deltaT
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_point).

Rs Δ temperature notes / to do

  • understanding differences between the two figures - that from 10.03 is most likely what I will include in the report
  • reasoning for this: the difference in water content is smaller for the 10.03 measurement in comparison to 07.03
  • the goal of the ΔT experiment is to control for moisture, therefore the experimental run with a smaller water content difference is best in line with the question (how does Rs change with temperature independent of moisture)
  • statistical tests for looking at the differences between linear models
  • re-check variables that went into the Rs calculation
  • sample sizes defined as
  • 07.03: n = 3 for both treatments (9 leaves per run in the chamber)
  • 10.03: n = 3 for both treatments (9 leaves per run in the chamber)

_Δ moisture

experimental setup - leaves were harvested and hydrated by the same method in the ΔT experiment. the goal of this segment is to see how changes in moisture affect Rs independent of temperature. once leaves were ‘fully hydrated’, a subset of 6 leaves was placed into the Rs chamber and measurements were recorded. this repeated for both treatments. continual measuremements were made at air-drying time intervals. these intervals depended on the sample size (outlined below)

CC - n = 5 * 0, 20, 40, 60, 80 min intervals for measurements (each measurement n = 2)

SC - n = 4 * 0, 20, 50, 65 (+ 2 min in 60°C oven dried) intervals (each measurement n = 2)

water content percentages for the treatments at respective time intervals (in minutes) are as follows:

CC air dry interval water content %
0 72.2
20 68.0
40 58.1
60 53.8
80 54.1
SC air dry interval water content %
0 78.8
20 75.6
50 62.5
65 + 2 OD 54.1

the ideal range of wc% captured would be within the range that was observed for weekly field moisture measurements. this usually fell between 50 - 85%, so the experiment captures the range that leaf litter would experience in the field rather well

deltaM <- read.csv("deltaM_compiled.csv")

# change wc% to categorical variable 
deltaM$wc_percent=as.factor(deltaM$wc_percent)
str(deltaM)
## 'data.frame':    40 obs. of  20 variables:
##  $ Obs       : int  41 82 123 164 205 246 282 319 357 395 ...
##  $ HHMMSS    : Factor w/ 40 levels "09:38:04","09:41:50",..: 1 2 3 4 5 6 7 8 9 10 ...
##  $ FTime     : num  733 958 1210 1457 1703 ...
##  $ Plot.     : int  77 77 77 77 77 77 77 77 77 77 ...
##  $ Mode      : int  4 4 4 4 4 4 4 4 4 4 ...
##  $ Smpls     : int  200 200 200 200 200 198 173 178 181 184 ...
##  $ EFFLUX    : num  0.517 0.535 0.537 0.523 0.506 ...
##  $ C2avg     : int  510 510 510 510 510 510 510 510 510 510 ...
##  $ Wavg      : num  23.8 26.1 26.8 27.1 27.4 ...
##  $ dc..dt    : num  0.0339 0.0351 0.0352 0.0343 0.0332 ...
##  $ Vtot      : int  1234 1234 1234 1234 1234 1234 1234 1234 1234 1234 ...
##  $ RHcmbr.   : num  83.6 89 89.1 88.5 87.8 ...
##  $ Tsoil_C   : num  21 22 22.5 22.7 22.9 ...
##  $ RHirga.   : num  83 88.6 88.8 88.3 87.7 ...
##  $ Tsch_C    : num  23.3 23.6 24 24.4 24.7 ...
##  $ dC.dt     : num  0.0535 0.093 0.0813 0.0818 0.0875 ...
##  $ dW.dt     : num  2.79e-02 4.26e-03 3.39e-03 1.15e-03 9.58e-05 ...
##  $ Rs        : num  115 200 175 175 188 ...
##  $ wc_percent: Factor w/ 9 levels "53.75","54.12844037",..: 7 7 7 7 7 6 6 6 6 6 ...
##  $ treatment : Factor w/ 2 levels "CC","SC": 1 1 1 1 1 1 1 1 1 1 ...
# create subset particular to each treatment (SC and CC)
deltaM_SC <- subset(deltaM, treatment == "SC")
deltaM_SC_troubleshoot <- read.csv("deltaM_SC_troubleshoot.csv")
str(deltaM_SC)
## 'data.frame':    18 obs. of  20 variables:
##  $ Obs       : int  894 936 977 1018 1059 1100 1135 1171 1206 1241 ...
##  $ HHMMSS    : Factor w/ 40 levels "09:38:04","09:41:50",..: 23 24 25 26 27 28 29 30 31 32 ...
##  $ FTime     : num  10058 10292 10499 10700 10900 ...
##  $ Plot.     : int  77 77 77 77 77 77 77 77 77 77 ...
##  $ Mode      : int  4 4 4 4 4 4 4 4 4 4 ...
##  $ Smpls     : int  200 200 200 200 200 200 169 171 169 169 ...
##  $ EFFLUX    : num  0.521 0.575 0.578 0.581 0.585 ...
##  $ C2avg     : int  455 455 455 455 455 455 455 455 455 455 ...
##  $ Wavg      : num  26.1 29.3 30.1 30.5 30.7 ...
##  $ dc..dt    : num  0.0342 0.0377 0.0379 0.0382 0.0384 ...
##  $ Vtot      : int  1234 1234 1234 1234 1234 1234 1234 1234 1234 1234 ...
##  $ RHcmbr.   : num  82.6 91.3 93 93.8 94.1 ...
##  $ Tsoil_C   : num  22.7 23.9 24.4 24.6 24.7 ...
##  $ RHirga.   : num  71.3 79.4 81.1 81.9 82.2 ...
##  $ Tsch_C    : num  25 25.1 25.2 25.3 25.4 ...
##  $ dC.dt     : num  0.0732 0.0744 0.0837 0.0836 0.0956 ...
##  $ dW.dt     : num  0.035343 0.007403 0.00249 0.001615 -0.000248 ...
##  $ Rs        : num  170 173 194 194 222 ...
##  $ wc_percent: Factor w/ 9 levels "53.75","54.12844037",..: 9 9 9 9 9 8 8 8 8 8 ...
##  $ treatment : Factor w/ 2 levels "CC","SC": 2 2 2 2 2 2 2 2 2 2 ...
str(deltaM_SC_troubleshoot)
## 'data.frame':    18 obs. of  20 variables:
##  $ Obs       : int  894 936 977 1018 1059 1100 1135 1171 1206 1241 ...
##  $ HHMMSS    : Factor w/ 18 levels "12:13:24","12:17:17",..: 1 2 3 4 5 6 7 8 9 10 ...
##  $ FTime     : num  10058 10292 10499 10700 10900 ...
##  $ Plot.     : int  77 77 77 77 77 77 77 77 77 77 ...
##  $ Mode      : int  4 4 4 4 4 4 4 4 4 4 ...
##  $ Smpls     : int  200 200 200 200 200 200 169 171 169 169 ...
##  $ EFFLUX    : num  0.521 0.575 0.578 0.581 0.585 ...
##  $ C2avg     : int  455 455 455 455 455 455 455 455 455 455 ...
##  $ Wavg      : num  26.1 29.3 30.1 30.5 30.7 ...
##  $ dc..dt    : num  0.0342 0.0377 0.0379 0.0382 0.0384 ...
##  $ Vtot      : int  1234 1234 1234 1234 1234 1234 1234 1234 1234 1234 ...
##  $ RHcmbr.   : num  82.6 91.3 93 93.8 94.1 ...
##  $ Tsoil_C   : num  22.7 23.9 24.4 24.6 24.7 ...
##  $ RHirga.   : num  71.3 79.4 81.1 81.9 82.2 ...
##  $ Tsch_C    : num  25 25.1 25.2 25.3 25.4 ...
##  $ dC.dt     : num  0.0732 0.0744 0.0837 0.0836 0.0956 ...
##  $ dW.dt     : num  0.035343 0.007403 0.00249 0.001615 -0.000248 ...
##  $ Rs        : num  170 173 194 194 222 ...
##  $ wc_percent: num  78.8 78.8 78.8 78.8 78.8 ...
##  $ treatment : Factor w/ 1 level "SC": 1 1 1 1 1 1 1 1 1 1 ...
deltaM_SC_troubleshoot$wc_percent=as.factor(deltaM_SC_troubleshoot$wc_percent)
deltaM_CC <- subset(deltaM, treatment == "CC")
# look at the variation of measurements across RT (which slightly varies over the course of measurements)
# need to determine if there is significant difference to be found as the temperature naturally increases 
# over the course of measurements being taken 
deltaM_CC_plot <- ggplot(deltaM_CC, aes(x = Tsoil_C, y = Rs, color = wc_percent))+
  geom_line()+
  geom_point()
deltaM_CC_plot

each line represents a different series of measurements at a given water content for the current conditions treatment leaf litter. during each measurement, temperature slightly rose as 4-5 data points were recorded.

repeat this figure for the snow cover treatment leaf litter:

deltaM_SC <- ggplot(deltaM_SC_troubleshoot, aes(x = Tsoil_C, y = Rs, color = wc_percent))+
  geom_line()+
  geom_point()
deltaM_SC

the question here is whether or not all points within a particular wc% measurement (usually 4 or 5 points/records for a give measurement) can be averaged. it is not clear to me whether or not this is appropriate because temperature is not truly constant (range is about 21°C - 25°C)

if the case is that they can be averaged, then we want to see how Rs stacks up between the treatments as moisture decreases (below for current conditions treatmnet):

deltaM_CC_plot <- ggplot(deltaM_CC, aes(x = wc_percent, y = Rs, color = wc_percent))+
  geom_boxplot()+
  labs(x="leaf litter water content (%)", 
       y="Rs (ug CO[2] g dry mass leaf litter ^-1 s^-1",
       title="current conditions - effect of increasing moisture on Rs")

deltaM_CC_plot 

below for snow cover treatment:

deltaM_SC_plot <- ggplot(deltaM_SC_troubleshoot, aes(x = wc_percent, y = Rs, color = wc_percent))+
  geom_boxplot()+
  labs(x="leaf litter water content (%)", 
       y="Rs (ug CO[2] g dry mass leaf litter ^-1 s^-1",
       title="snow cover conditions - effect of increasing moisture on Rs")

deltaM_SC_plot

combining the two in which fill (green / orange coloring) determines the treatment type

deltaM_summary_plot <- ggplot(deltaM, aes(x = wc_percent, y = Rs, fill = treatment))+
  geom_boxplot()+
  labs(x="leaf litter water content (%)", 
       y="Rs (ug CO[2] g dry mass leaf litter ^-1 s^-1",
       title="combined SC / CC - effect of increasing moisture on Rs")+
  theme(axis.text.x = element_text(angle = 45))
deltaM_summary_plot

just an idea to mess around with if the effect of temperature is deemed not significant:

#library(tidyverse)

deltaM_CC_mean <- deltaM_CC %>% 
  group_by(wc_percent) %>% 
  summarize(average = mean(Rs))

deltaM_CC_mean$average_RS = deltaM_CC_mean$average

deltaM_SC_mean <- deltaM_SC_troubleshoot %>% 
  group_by(wc_percent) %>% 
  summarize(average = mean(Rs))

deltaM_SC_mean$average_RS = deltaM_SC_mean$average

changing wc percent to a continuous variable to investigate if there is a linear trend

deltaM_CC_mean$wc_percent <- as.numeric(as.character(deltaM_CC_mean$wc_percent))
str(deltaM_CC_mean)
## Classes 'tbl_df', 'tbl' and 'data.frame':    5 obs. of  3 variables:
##  $ wc_percent: num  53.8 54.2 58.1 68 72.2
##  $ average   : num  117 128 168 168 171
##  $ average_RS: num  117 128 168 168 171
deltaM_SC_mean$wc_percent <- as.numeric(as.character(deltaM_SC_mean$wc_percent))
str(deltaM_SC_mean)
## Classes 'tbl_df', 'tbl' and 'data.frame':    4 obs. of  3 variables:
##  $ wc_percent: num  54.1 62.5 75.6 78.8
##  $ average   : num  150 188 211 191
##  $ average_RS: num  150 188 211 191

plot results:

# merge mean data frames for both treatments 

deltaM_CC_mean$treatment <- "CC"
deltaM_SC_mean$treatment <- "SC"

deltaM_mean <- rbind(deltaM_CC_mean, deltaM_SC_mean)

deltaM_mean_plot <- ggplot(deltaM_mean, aes(x = wc_percent, y = average_RS, color = treatment))+
  geom_line()+
  geom_point()
deltaM_mean_plot

looking closer at trends - linear used here, possibly not the best fit

deltaM_mean_plot_lm <- ggplot(deltaM_mean, aes(x = wc_percent, y = average_RS, color = treatment))+
  geom_line()+
  geom_point()+
  geom_smooth(method=lm, aes(fill=treatment))

deltaM_mean_plot_lm 

Rs Δ moisture notes / to do

  • statistical tests for looking at the differences between treatments and Rs
  • understand the impact / considerations for slightly variable room temperatures
  • re-check variables that went into the Rs calculation
  • sample sizes defined as
  • SC: n = 4 for both treatments (6 leaves per run in the chamber)
  • CC: n = 5 for both treatments (6 leaves per run in the chamber)
  • appropriate / most sensible way to display this data