Importing and Processing data

AFDW-normalized Metabolic rates

GPP vs temperature and nutrients

# linear model of GPP and temp
GPP_AFDW_mod <- lm(GPP_mgO2_d_gAFDW ~ temp_C*nutrients, dat)
summary(GPP_AFDW_mod)
## 
## Call:
## lm(formula = GPP_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -245.17 -102.90  -15.01   47.87  822.76 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)       -212.21     282.23  -0.752   0.4586  
## temp_C              27.24      14.54   1.873   0.0719 .
## nutrients          346.55     396.64   0.874   0.3900  
## temp_C:nutrients   -20.49      20.50  -1.000   0.3264  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 193.8 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.1333, Adjusted R-squared:  0.03699 
## F-statistic: 1.384 on 3 and 27 DF,  p-value: 0.2689
dat %>%
  ggplot(aes(x = temp_C, y = GPP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  scale_color_discrete(name = "Nutrient Treatment")+
  theme_classic() +
  labs(title = "Periphyton GPP vs. Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(GPP~(mgO[2]~day^{-1}~gAFDW^{-1})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# simplified plot
GPP_AFDW_model_plot <- dat %>%
  ggplot(aes(x = temp_C, y = GPP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  scale_color_discrete(name = "Nutrient Treatment")+
  theme_classic() +
  labs(title = "Periphyton GPP vs. Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(GPP~(mgO[2]~day^{-1}~gAFDW^{-1})))

GPP_AFDW_model_plot
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).

ggsave("plots/210613_pineland_ambient_enriched/210613_GPP_AFDW_model_plot.png", plot = GPP_AFDW_model_plot, width = 7, height = 3.5)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).
# dataset with single outlier (chamber 1) removed
dat_clean <- dat %>%
  filter(!chamber == 1)

# model of ER with single outlier (chamber 1) removed
GPP_AFDW_mod2 <- lm(GPP_mgO2_d_gAFDW ~ temp_C*nutrients, dat_clean)
summary(GPP_AFDW_mod2)
## 
## Call:
## lm(formula = GPP_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat_clean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -185.453  -48.806    2.213   46.822  187.995 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)
## (Intercept)      193.55042  125.03381   1.548    0.134
## temp_C             2.50933    6.55259   0.383    0.705
## nutrients         11.84179  175.92792   0.067    0.947
## temp_C:nutrients  -0.06709    9.24417  -0.007    0.994
## 
## Residual standard error: 82.07 on 25 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.01585,    Adjusted R-squared:  -0.1022 
## F-statistic: 0.1342 on 3 and 25 DF,  p-value: 0.9387
dat_clean %>%
  ggplot(aes(x = temp_C, y = GPP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  scale_color_discrete(name = "Nutrient Treatment")+
  theme_classic() +
  labs(title = "Periphyton GPP vs. Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(GPP~(mgO[2]~day^{-1}~gAFDW^{-1})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

ER vs temperature and nutrients

ER_AFDW_mod <- lm(ER_mgO2_d_gAFDW ~ temp_C*nutrients, dat)
summary(ER_AFDW_mod)
## 
## Call:
## lm(formula = ER_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -273.326  -17.585    4.027   29.206   79.582 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)       117.174     92.931   1.261   0.2181  
## temp_C            -11.034      4.788  -2.304   0.0291 *
## nutrients        -118.963    130.605  -0.911   0.3704  
## temp_C:nutrients    6.200      6.749   0.919   0.3664  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 63.81 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.1902, Adjusted R-squared:  0.1003 
## F-statistic: 2.114 on 3 and 27 DF,  p-value: 0.1218
dat %>%
  ggplot(aes(x = temp_C, y = ER_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "ER response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(ER~(mgO[2]~day^{-1}~gAFDW^{-1})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# simplified plot w/o axis labels for use in plotly--This is used to identify which chambers correspond to outlier datapoints
p <- dat %>%
  ggplot(aes(x = temp_C, y = ER_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(aes(group = chamber), shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  theme_classic() +
  labs(title = "ER response to Temperature")

ER_plot <- plotly::ggplotly(p)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
ER_plot
# model of ER with single outlier (chamber 1) removed
ER_AFDW_mod2 <- lm(ER_mgO2_d_gAFDW ~ temp_C*nutrients, dat_clean)
summary(ER_AFDW_mod2)
## 
## Call:
## lm(formula = ER_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat_clean)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -43.940 -16.231  -1.944  15.092  46.952 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)      -17.6221    37.2379  -0.473    0.640
## temp_C            -2.8194     1.9515  -1.445    0.161
## nutrients        -14.2457    52.3953  -0.272    0.788
## temp_C:nutrients  -0.1914     2.7531  -0.070    0.945
## 
## Residual standard error: 24.44 on 25 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.2479, Adjusted R-squared:  0.1576 
## F-statistic: 2.746 on 3 and 25 DF,  p-value: 0.06412
# Plot of this model
dat_clean %>%
  ggplot(aes(x = temp_C, y = ER_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "ER response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(ER~(mgO[2]~day^{-1}~gAFDW^{-1})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

Chamber 1 had unusually large ER, though it’s not quite clear why. This chamber had the lowest AFDW of all chambers (not by a large margin), and an average-looking total DW. The rock was average-sized according to the water volume measurements for the chambers.

NEP vs. temp and nutrients

# linear model of NEP and temp
NEP_AFDW_mod <- lm(NEP_mgO2_d_gAFDW ~ temp_C*nutrients, dat)
summary(NEP_AFDW_mod)
## 
## Call:
## lm(formula = NEP_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -165.58  -66.68    0.60   29.88  549.44 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)       -95.038    190.938  -0.498    0.623
## temp_C             16.203      9.838   1.647    0.111
## nutrients         227.584    268.344   0.848    0.404
## temp_C:nutrients  -14.288     13.867  -1.030    0.312
## 
## Residual standard error: 131.1 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.1201, Adjusted R-squared:  0.02228 
## F-statistic: 1.228 on 3 and 27 DF,  p-value: 0.3188
dat %>%
  ggplot(aes(x = temp_C, y = NEP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "NEP response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(NEP~(mgO[2]~day^{-1}~gAFDW)))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# simplified plot w/o axis labels for use in plotly--This is used to identify which chambers correspond to outlier datapoints
p <- dat %>%
  ggplot(aes(x = temp_C, y = NEP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(aes(group = chamber), shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  theme_classic() +
  labs(title = "NEP response to Temperature")

NEP_plot <- plotly::ggplotly(p)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
NEP_plot
# dataset with single outlier (chamber 1) removed
dat_clean <- dat %>%
  filter(!chamber == 1)

# model of ER without potential outlier
NEP_AFDW_mod2 <- lm(NEP_mgO2_d_gAFDW ~ temp_C*nutrients, dat_clean)
summary(NEP_AFDW_mod2)
## 
## Call:
## lm(formula = NEP_mgO2_d_gAFDW ~ temp_C * nutrients, data = dat_clean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -138.502  -35.423   -0.545   26.942  145.171 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)      175.9283    91.3051   1.927   0.0654 .
## temp_C            -0.3101     4.7850  -0.065   0.9488  
## nutrients         -2.4040   128.4702  -0.019   0.9852  
## temp_C:nutrients  -0.2585     6.7505  -0.038   0.9698  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 59.93 on 25 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.004908,   Adjusted R-squared:  -0.1145 
## F-statistic: 0.0411 on 3 and 25 DF,  p-value: 0.9886
dat_clean %>%
  ggplot(aes(x = temp_C, y = NEP_mgO2_d_gAFDW, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "NEP response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(NEP~(mgO[2]~day^{-1}~gAFDW)))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

Looks like chamber 1 is an outlier and has unusually high NEP in the 23.5C treatment. Again, it’s not clear what is the cause of this outlier besides measurement error.

SA-normalized metabolic rates

GPP vs temperature and nutrients model

# linear model of GPP and temp
GPP_SA_mod <- lm(GPP_mgO2_d_m2 ~ temp_C*nutrients, dat)
summary(GPP_SA_mod)
## 
## Call:
## lm(formula = GPP_mgO2_d_m2 ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1584.6  -411.3  -114.2   394.5  1999.9 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)       -446.86    1139.24  -0.392  0.69796   
## temp_C             166.81      58.70   2.842  0.00844 **
## nutrients         2076.52    1601.08   1.297  0.20562   
## temp_C:nutrients  -115.21      82.74  -1.392  0.17516   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 782.3 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.2514, Adjusted R-squared:  0.1683 
## F-statistic: 3.023 on 3 and 27 DF,  p-value: 0.04688
GPP_SA_plot <- dat %>%
  ggplot(aes(x = temp_C, y = GPP_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "GPP response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(GPP~(mgO[2]~day^{-1}~m^{-2})))
GPP_SA_plot
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# making simplified plot w/o expressions for use in plotly function
GPP_SA <- dat %>%
  ggplot(aes(x = temp_C, y = GPP_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(aes(group = chamber), shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic()
# interactive plotly plot to get info on individual data points
GPP_SA_plotly <- plotly::ggplotly(GPP_SA)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
GPP_SA_plotly

ER vs temp and nutrients

# linear model of GPP and temp
ER_SA_mod <- lm(ER_mgO2_d_m2 ~ temp_C*nutrients, dat)
summary(ER_SA_mod)
## 
## Call:
## lm(formula = ER_mgO2_d_m2 ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -671.64 -170.28   70.14  149.75  480.86 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        530.58     397.47   1.335   0.1931   
## temp_C             -71.37      20.48  -3.485   0.0017 **
## nutrients         -766.76     558.60  -1.373   0.1812   
## temp_C:nutrients    34.69      28.87   1.202   0.2400   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 272.9 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3785, Adjusted R-squared:  0.3095 
## F-statistic: 5.482 on 3 and 27 DF,  p-value: 0.004492
dat %>%
  ggplot(aes(x = temp_C, y = ER_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "ER response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(ER~(mgO[2]~day^{-1}~m^{-2})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# making simplified plot without expressions in the axis labels for plotly
ER_SA_plot <- dat %>%
  ggplot(aes(x = temp_C, y = ER_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(aes(group = chamber), shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic()

# ploting interactive plot in plotly to identify which datapoints correspond to which chambers
ER_SA_plotly <- plotly::ggplotly(ER_SA_plot)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
ER_SA_plotly

NEP vs temp and nutrients

# linear model of NEP and temp
NEP_SA_mod <- lm(NEP_mgO2_d_m2 ~ temp_C*nutrients, dat)
summary(NEP_SA_mod)
## 
## Call:
## lm(formula = NEP_mgO2_d_m2 ~ temp_C * nutrients, data = dat)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1103.77  -284.14   -34.51   214.47  1328.28 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)         83.73     770.89   0.109   0.9143  
## temp_C              95.45      39.72   2.403   0.0234 *
## nutrients         1309.75    1083.40   1.209   0.2372  
## temp_C:nutrients   -80.52      55.99  -1.438   0.1619  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 529.4 on 27 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.2145, Adjusted R-squared:  0.1273 
## F-statistic: 2.458 on 3 and 27 DF,  p-value: 0.08444
dat %>%
  ggplot(aes(x = temp_C, y = NEP_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  stat_regline_equation() +
  theme_classic() +
  labs(title = "NEP response to Temperature",
      x = expression('Temperature (\u00B0C)'),
      y = expression(NEP~(mgO[2]~day^{-1}~m^{-2})))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing non-finite values (stat_regline_equation).
## Warning: Removed 1 rows containing missing values (geom_point).

# making simplified plot without expressions in the axis labels for plotly
NEP_SA_plot <- dat %>%
  ggplot(aes(x = temp_C, y = NEP_mgO2_d_m2, color = nutrient_trt)) +
  geom_point(aes(group = chamber), shape = 19, size = 2) +
  geom_smooth(method = "lm") +
  theme_classic()

# ploting interactive plot in plotly to identify which datapoints correspond to which chambers
NEP_SA_plotly <- plotly::ggplotly(NEP_SA_plot)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
NEP_SA_plotly

Plotting additional Variables to asses outlier datapoints

#View(dat)
# plot of total AFDW of all chambers
dat %>%
  ggplot(aes(x = chamber, y = total_AFDW_g)) +
  geom_col() +
  theme_classic()

# plot of total DW of all chambers
dat %>%
  ggplot(aes(x = chamber, y = total_DW_g)) +
  geom_col() +
  theme_classic()

# plot of rock surface area of all chambers
dat %>%
  ggplot(aes(x = chamber, y = rock_SA_m2)) +
  geom_col() +
  theme_classic()

# calculating average total AFDW for thi incubation to compare to that of other incubations
mean(dat$total_AFDW_g)
## [1] 0.1852498
### calculating average AFDW/m2 for the ambient and enriched incubations
avg_AFDW <- dat %>%
  filter(nutrient_trt == "ambient") %>% # subsetting to only include ambient since same rocks were used for ambient and enriched and would artificially double the sample size used to calculate the sd
  summarize(avg_AFDW_g_m2 = mean(total_AFDW_g/rock_SA_m2), sd_AFDW_g_m2 = sd(total_AFDW_g/rock_SA_m2))
avg_AFDW

Looks like average AFDW/m2 during the april 2020 incubations was 23 +- 8 g/m2, which is nearly double that of this incubation. Thus there may be a lack of temperature and nutrient effects either due to this, or due to a lack of temperature response at this higher range of temperatures.