This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.

This code is a record of analyzing the PhotosynQ data recorded on the five Cowpea accessions phenotyped in Fall 2021.

getwd()
## [1] "/Users/julkowskalab/Desktop/Fall 2021 Cowpea analysis"
setwd("/Users/julkowskalab/Desktop/Fall 2021 Cowpea analysis")
list.files(pattern=".csv")
## [1] "cowpea_pot_geno_HS.csv"                                      
## [2] "photo_data_fall2021_HSOK.csv"                                
## [3] "photo_data_fall2021_HSOK.xlsx - Photosynthesis RIDES 2.0.csv"
Photo_fall21 <- read.csv("photo_data_fall2021_HSOK.csv")
geno <- read.csv("/Users/julkowskalab/Desktop/Fall 2021 Cowpea analysis/cowpea_pot_geno_HS.csv")

geno
Photo_fall21
#install.packages(c("ggplot2", "ggpubr", "cowplot", "reshape2"))
library("ggplot2")
library("cowplot")
library("ggpubr")
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:cowplot':
## 
##     get_legend
library("reshape2")
colnames(Photo_fall21)
##  [1] "Datum.ID"                      "Repeat"                       
##  [3] "Treatment"                     "Pot.number"                   
##  [5] "Day"                           "leaf.angle"                   
##  [7] "test_data_raw_PAM"             "pump"                         
##  [9] "ECS_averaged_trace"            "fitinput"                     
## [11] "outdata"                       "ECSt.mAU"                     
## [13] "ECS_tau"                       "gH."                          
## [15] "vH."                           "P700_DIRK_averaged_trace"     
## [17] "P700_fitinput"                 "P700_outdata"                 
## [19] "P700_DIRK_ampl"                "tP700"                        
## [21] "kP700"                         "v_initial_P700"               
## [23] "LEFd_trace"                    "data_raw_PAM"                 
## [25] "Fs"                            "FoPrime"                      
## [27] "Phi2"                          "PhiNPQ"                       
## [29] "qL"                            "NPQt"                         
## [31] "PhiNO"                         "FvP_over_FmP"                 
## [33] "FmPrime"                       "PSI_data_absorbance"          
## [35] "PS1.Active.Centers"            "PS1.Open.Centers"             
## [37] "PS1.Over.Reduced.Centers"      "PS1.Oxidized.Centers"         
## [39] "humidity_K"                    "humidity2_K"                  
## [41] "air_temp_kinetics"             "leaf_thickness"               
## [43] "LEAF_temp"                     "Light.Intensity..PAR."        
## [45] "Ambient.Temperature"           "Ambient.Humidity"             
## [47] "Ambient.Pressure"              "Leaf.Temperature"             
## [49] "Leaf.Temperature.Differential" "LEF"                          
## [51] "Leaf.Temperature.Differenial"  "SPAD"                         
## [53] "User"                          "Device.ID"                    
## [55] "Status"                        "Notes"                        
## [57] "Latitude"                      "Longitude"
Photosyn_selected <- Photo_fall21[,c(5, 4, 3, 26, 28, 32:33, 35:38, 42, 48, 52)]
Photosyn_selected
colnames(geno)
## [1] "Pot.number" "genotype"
geno
Photosyn_geno <- merge(Photosyn_selected, geno, all = TRUE)
Photosyn_geno <- na.omit(Photosyn_geno)
Photosyn_geno[order(Photosyn_geno$Day),]
FoPrime_histo <- FoPrime_histo <- gghistogram(Photosyn_geno, x = "FoPrime",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FoPrime")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FoPrime_histo

PhiNPQ_histo <- gghistogram(Photosyn_geno, x = "PhiNPQ",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PhiNPQ")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PhiNPQ_histo

FvP_over_FmP_histo <- gghistogram(Photosyn_geno, x = "FvP_over_FmP",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FvP_over_FmP")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FvP_over_FmP_histo

FvP_over_FmP_histo <- gghistogram(Photosyn_geno, x = "FvP_over_FmP",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FvP_over_FmP")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FvP_over_FmP_histo

PS1.Active.Centers_histo <- gghistogram(Photosyn_geno, x = "PS1.Active.Centers",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Active.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Active.Centers_histo

PS1.Open.Centers_histo <- gghistogram(Photosyn_geno, x = "PS1.Open.Centers",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Open.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Open.Centers_histo

SPAD_histo <- gghistogram(Photosyn_geno, x = "SPAD",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("SPAD")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
SPAD_histo

PS1.Oxidized.Centers_histo <- gghistogram(Photosyn_geno, x = "PS1.Oxidized.Centers",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Oxidized.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Oxidized.Centers_histo

leaf_thickness_histo <- gghistogram(Photosyn_geno, x = "leaf_thickness",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("leaf_thickness")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
leaf_thickness_histo

Leaf.Temperature_histo <- gghistogram(Photosyn_geno, x = "Leaf.Temperature",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("Leaf.Temperature")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
Leaf.Temperature_histo

SPAD_histo <- gghistogram(Photosyn_geno, x = "SPAD",
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("SPAD")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
SPAD_histo

#find other funky points
FUNKY_ActiveCenters <- subset(Photosyn_geno, Photosyn_geno$PS1.Active.Centers > 40)
FUNKY_ActiveCenters
#funky active centers shows pot 23 (~277), day 12 control
FUNKY_OpenCenters <- subset(Photosyn_geno, Photosyn_geno$PS1.Open.Centers > 50)
FUNKY_OpenCenters
#funky open centers shows pot 26 (~752), day 14 control
FUNKY_OverReduced <- subset(Photosyn_geno, Photosyn_geno$SPAD < -50)
FUNKY_OverReduced
#funky over reduced centers shows pot 26 (~-1237), day 14 control
FUNKY_OxidizedCenters <- subset(Photosyn_geno, Photosyn_geno$PS1.Oxidized.Centers > 50)
FUNKY_OxidizedCenters
#funky oxidized centers shows pot 26 (~486), day 14 control 
FUNKY_leafthickness <- subset(Photosyn_geno, Photosyn_geno$leaf_thickness > 2)
FUNKY_leafthickness
#funky leaf thickness shows pot 58, day 26 drought and pot 81, day 21 salt. Both have thickness ~4 (pot58, d 26 outlier? Goes back down. Yes exclude both - Magda)
FUNKY_spad <- subset(Photosyn_geno, Photosyn_geno$SPAD < 5)
FUNKY_spad
#funky spad shows pot 34, day 26 control. SPAD is ~4 (not outlier)

getting rid of stuff:

Photosyn_geno$Pot_Day <- paste(Photosyn_geno$Pot.number, Photosyn_geno$Day, sep = "_")
# we're also going to fully remove pot 26, day 14 because it is consistently an outlier: 
Photosyn_geno2 <- subset(Photosyn_geno, Photosyn_geno$Pot_Day != "26_14")
# let's list all of the outliers we would like to replace with NA:
Photosyn_geno2$PS1.Active.Centers <- gsub("277.723", "n.a.", Photosyn_geno2$PS1.Active.Centers)
Photosyn_geno2$PS1.Active.Centers <- as.numeric(as.character(Photosyn_geno2$PS1.Active.Centers))
## Warning: NAs introduced by coercion
Photosyn_geno2$leaf_thickness <- gsub("4.16", "n.a.", Photosyn_geno2$leaf_thickness)
Photosyn_geno2$leaf_thickness <- as.numeric(as.character(Photosyn_geno2$leaf_thickness))
## Warning: NAs introduced by coercion
Photosyn_geno2$leaf_thickness <- gsub("4.18", "n.a.", Photosyn_geno2$leaf_thickness)
Photosyn_geno2$leaf_thickness <- as.numeric(as.character(Photosyn_geno2$leaf_thickness))
## Warning: NAs introduced by coercion
#we're going to change the Day values to days after stress, where 12 = -2 (day before stress), 14 = day 0 (day of stress)
Photosyn_geno2$Day <- gsub("12", "-2", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("14", "0", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("16", "2", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("19", "5", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("21", "8", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("23", "10", Photosyn_geno2$Day)
Photosyn_geno2$Day <- gsub("26", "13", Photosyn_geno2$Day)
Photosyn_geno2
Photosyn_geno2$Day <- factor(Photosyn_geno2$Day, levels = c("-2", "0", "2", "5", "8", "10", "13"))
#re-do of histograms with excluded rows
FoPrime_histo <- FoPrime_histo <- gghistogram(Photosyn_geno2, x = "FoPrime", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FoPrime")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FoPrime_histo

PhiNPQ_histo <- gghistogram(Photosyn_geno2, x = "PhiNPQ", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PhiNPQ")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PhiNPQ_histo

FvP_over_FmP_histo <- gghistogram(Photosyn_geno2, x = "FvP_over_FmP", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FvP_over_FmP")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FvP_over_FmP_histo

FmPrime_histo <- gghistogram(Photosyn_geno2, x = "FmPrime", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("FmPrime")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FmPrime_histo

PS1.Active.Centers_histo <- gghistogram(Photosyn_geno2, x = "PS1.Active.Centers", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Active.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Active.Centers_histo

PS1.Open.Centers_histo <- gghistogram(Photosyn_geno2, x = "PS1.Open.Centers", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Open.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Open.Centers_histo

PS1.Over.Reduced.Centers_histo <- gghistogram(Photosyn_geno2, x = "PS1.Over.Reduced.Centers", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Over.Reduced.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Over.Reduced.Centers_histo

PS1.Oxidized.Centers_histo <- gghistogram(Photosyn_geno2, x = "PS1.Oxidized.Centers", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("PS1.Oxidized.Centers")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
PS1.Oxidized.Centers_histo

leaf_thickness_histo <- gghistogram(Photosyn_geno2, x = "leaf_thickness", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("leaf_thickness")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
leaf_thickness_histo

Leaf.Temperature_histo <- gghistogram(Photosyn_geno2, x = "Leaf.Temperature", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("Leaf.Temperature")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
Leaf.Temperature_histo

SPAD_histo <- gghistogram(Photosyn_geno2, x = "SPAD", na.rm = TRUE,
                            add = "mean", rug = TRUE,
                            color = "Treatment", fill = "Treatment", facet.by = "Day",
                            palette = c("blue", "orange", "darkgreen")) + xlab("SPAD")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
SPAD_histo

Photosyn_geno2
#Looking at how traits are changing through time
#Photosyn_geno2$Day <- as.factor(Photosyn_geno2$Day)

#Alternative solution
#Photosyn_geno2$Day <- factor(Photosyn_geno2$Day, levels = c("-2", "0", "2", "5", "8", "10", "13"))

#Photosyn_geno2$Day <- as.numeric(as.character(Photosyn_geno2$Day))
# make separate graphs for control vs drought and control vs salt
unique(Photosyn_geno2$Day)
## [1] 13 10 8  5  2  0  -2
## Levels: -2 0 2 5 8 10 13
control_salt <- subset(Photosyn_geno2, Photosyn_geno2$Treatment != "Drought")
control_salt
control_drought <- subset(Photosyn_geno2, Photosyn_geno2$Treatment != "Salt")
control_drought

We decided to just go straight into the Photosyn_geno data and remove the repeating data points. But, wanted to keep the code for how I wrangled the data in R for future reference

Creating a loop to look through data and identify pots that have too many measurement points

# unique(control_drought$Pot.number)
# 
# dim(control_drought)
# 464/71
# library(tidyr)
# install.packages("tidyverse")
# library(tidyverse)
# library(plyr)
# control_drought %>% count("Pot.number")
# control_salt %>% count("Pot.number")
# 
# control_drought2 <- control_drought %>% count("Pot.number")
# control_drought2
# control_drought2$unq <- 0
# 
# for(i in 1:nrow(control_drought2)){
#   temp <- subset(control_drought, control_drought$Pot.number == control_drought2$Pot.number[i])
#   control_drought2$unq[i] <- length(unique(temp$Day))
#   control_drought2
# }
# #
# control_drought2$dif <- control_drought2$freq - control_drought2$unq
# suspicious_drought <- subset(control_drought2, control_drought2$dif != 0)
# suspicious_drought
# 
# control_salt2 <- control_salt %>% count("Pot.number")
# control_salt2
# control_salt2$unq <- 0
# #
# for(i in 1:nrow(control_salt2)){
#   temp <- subset(control_salt, control_salt$Pot.number == control_salt2$Pot.number[i])
#   control_salt2$unq[i] <- length(unique(temp$Day))
#   control_salt2
# }
# 
# control_salt2$dif <- control_salt2$freq - control_salt2$unq
# suspicious_salt <- subset(control_salt2, control_salt2$dif != 0)
# suspicious_salt

Main issue for drought is pot 44 - one too many observations - lets have a look at it: Also, something is suspicious with pot 26, control For salt, one extra observation for pot 105

#control_drought_pot44 <- subset(control_drought, control_drought$Pot.number == 44)
#plot(control_drought_pot44$FoPrime ~ control_drought_pot44$Day)
# 
# control_drought_pot26 <- subset(control_drought, control_drought$Pot.number == 26)
# plot(control_drought_pot26$FoPrime ~ control_drought_pot26$Day)
# 
# 
# control_salt_pot105 <- subset(control_salt, control_salt$Pot.number == 105)
# plot(control_salt_pot105$FoPrime ~ control_salt_pot105$Day)

Subsetting data to average the repeating points.

# drought_44 <- subset(control_drought, control_drought$Pot.number == 44)
# drought_44
# drought_44_d10 <- subset(drought_44, drought_44$Day == "10")
# drought_44_d10
# sub_no44 <- subset(control_drought, control_drought$Pot.number != 44)
# #the measurement in line 304 seems to be more of an outlier so I am going to remove this one
# drought_44_good <- subset(drought_44, drought_44$FoPrime != 343)
# drought_44_good
# #recombine
# new_control_drought <- rbind(sub_no44, drought_44_good)
# new_control_drought
# new_control_drought_44 <- subset(new_control_drought, new_control_drought$Pot.number == 44)
# plot(new_control_drought_44$FoPrime ~ new_control_drought_44$Day)
# #pot 26 also suspicious (In both datasets)
# control_26 <- subset(Photosyn_geno2, Photosyn_geno2$Pot_Day == "26_19")
# control_26
# sub_no_26 <- subset(Photosyn_geno2, Photosyn_geno2$Pot_Day == "26_19")
# control_26_d5 <- subset(control_26, control_26$Day == "5")
# control_26_d5
# 
# #Going to take average of pot 26
# library(dplyr)
# control_26_d5_mean <- summarize_all(control_26_d5, mean)
# control_26_d5_mean
# control_26_d5_mean$Treatment <- "Control"
# control_26_d5_mean$genotype <- "CB5-2"
# control_26_d5_mean$Pot_Day <- "26_19"
# control_26_d5_mean
# #recombine
# new_control_26 <- rbind(control_26_d5, control_26_d5_mean)
# new_control_26
# control_26_good <- subset(new_control_26, new_control_26$FoPrime != 349.0 & new_control_salt$FoPrime != 318.0)
# control_26_good
# new_control_drought2 <- rbind(sub_no_26, control_26_good)
# new_control_drought2
# new_control_drought2_26 <- subset(new_control_drought2, new_control_drought2$Pot.number == 26)
# plot(new_control_drought2_26$FoPrime ~ new_control_drought2_26$Day)
# 
# salt_105 <- subset(control_salt, control_salt$Pot.number == 105)
# sub_no105 <- subset(control_salt, control_salt$Pot.number != 105)
# salt_105
# salt_105_dneg2 <- subset(salt_105, salt_105$Day == "-2")
# salt_105_dneg2
# #both of these points are for the most part fairly close, so I will average them and create a single data point for this pot/day 
# library(dplyr)
# salt_105_mean <- summarize_all(salt_105_dneg2, mean)
# salt_105_mean
# salt_105_mean$Treatment <- "Salt"
# salt_105_mean$genotype <- "Suvita-2"
# salt_105_mean$Pot_Day <- "105_12"
# salt_105_mean
# new_control_salt <- rbind(salt_105, salt_105_mean)
# new_control_salt
# salt_105_good <- subset(new_control_salt, new_control_salt$FoPrime != 366 & new_control_salt$FoPrime != 390)
# salt_105_good
# new_control_salt2 <- rbind(sub_no105, salt_105_good)
# new_control_salt2
# new_control_salt2_105 <- subset(new_control_salt2, new_control_salt2$Pot.number == 105)
# plot(new_control_salt2_105$FoPrime ~ new_control_salt2_105$Day)
# # unique id pot_day_Fo'
# # make new ID column
# # data$ID <- paste(data$Pot.number, data$Day, data$FoPrime, sep="_")
Bye <- c("44_23_343", "26_19_333.5", "105_12_378")
# checking the new pot data
# new_control_drought_26 <- subset(new_control_drought, new_control_drought$Pot.number == 26)
# plot(new_control_drought_26$FoPrime ~ new_control_drought_26$Day)

plotting the data

Now let’s plot the data - no outliers or repeats anymore note: x axis (in this case Day) must be as.factor for the stat compare means to work!

# control_salt$Day <- as.factor(control_salt$Day)

# FoPrime_over_time_s <- ggplot(data = control_salt, aes(x = Day, y = FoPrime, na.rm = TRUE, color = Treatment, id=Pot.number))
# FoPrime_over_time_s <- FoPrime_over_time_s + geom_line(alpha = 0.1)
# FoPrime_over_time_s <- FoPrime_over_time_s + stat_summary(fun.data = mean_se, linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.9, geom = "point", linetype = "dashed")
# FoPrime_over_time_s <- FoPrime_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
# FoPrime_over_time_s <- FoPrime_over_time_s + scale_color_manual(values = c("blue", "red")) + ylim(200, 550)
# FoPrime_over_time_s <- FoPrime_over_time_s + ylab("FoPrime over time") + theme(legend.position=c(0.1, 0.1))
# FoPrime_over_time_s

# new_control_drought$Day <- as.factor(as.character(new_control_drought$Day))
# new_control_drought$Day <- factor(new_control_drought$Day, levels = c(-2, 0, 2, 5, 8, 10, 13))

# library(plyr)
# control_drought2 <- new_control_drought %>% count("Pot.number")
# control_drought2$unq <- 0
# for(i in 1:nrow(control_drought2)){
#   temp <- subset(control_drought, control_drought$Pot.number == control_drought2$Pot.number[i])
#   control_drought2$unq[i] <- length(unique(temp$Day))
#   control_drought2
# }
# control_drought2
# control_drought2$dif <- control_drought2$freq - control_drought2$unq

Based on the above - let’s remove pot 71 and 53 - since they have very few measurements (<3):

byebye <- c("71", "53")
new_control_drought3 <- subset(control_drought, !(control_drought$Pot.number %in% byebye))
new_control_salt3 <- subset(control_salt, !(control_salt$Pot.number %in% byebye))
new_control_salt3
# unique(new_control_drought3$Pot.number)
# new_control_drought3$FoPrime <- as.numeric(as.character(new_control_drought3$FoPrime))
# new_control_drought3$Pot.number <- as.character(new_control_drought3$Pot.number)
# new_control_drought3$ID <- paste(new_control_drought3$genotype, new_control_drought3$Treatment, new_control_drought3$Pot.number, sep="_")
# unique(new_control_drought3$ID)
# length(unique(new_control_drought3$ID))
# length(unique(new_control_drought3$Pot.number))

graph from the very beginning:

# new_plot <- ggplot(data = new_control_drought3, aes(x = Day, y= FoPrime, color = Treatment))
# new_plot <- new_plot + geom_line(aes(group = ID))
# new_plot

Below is the re-make of the graphs showing PhotosynQ traits over time. We’ve excluded outliers, repeated values, and pots with less than 3 measurements. We’ve also separated by treatment

FoPrime_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = FoPrime, na.rm = TRUE, color = Treatment, group = Pot.number)) + theme_classic()
FoPrime_over_time_d <- FoPrime_over_time_d + geom_line(alpha = 0.1)
FoPrime_over_time_d <- FoPrime_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.9, geom = "line", linetype = "solid")
FoPrime_over_time_d <- FoPrime_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FoPrime_over_time_d <- FoPrime_over_time_d + scale_color_manual(values = c("blue", "red"))  + ylim(200, 550)
FoPrime_over_time_d <- FoPrime_over_time_d + ylab("FoPrime (a.u.)") + ggtitle("FoPrime Over Time - drought v control") + theme(legend.position="bottom")
FoPrime_over_time_d

FoPrime_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = FoPrime, na.rm = TRUE, color = Treatment, group = Pot.number)) + theme_classic()
FoPrime_over_time_s <- FoPrime_over_time_s + geom_line(alpha = 0.1)
FoPrime_over_time_s <- FoPrime_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.9, geom = "line", linetype = "solid")
FoPrime_over_time_s <- FoPrime_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FoPrime_over_time_s <- FoPrime_over_time_s + scale_color_manual(values = c("blue", "red")) + ylim(200, 550)
FoPrime_over_time_s <- FoPrime_over_time_s + ylab("FoPrime (a.u.)") + ggtitle("FoPrime Over Time - salt v control") + theme(legend.position="bottom")
FoPrime_over_time_s

PhiNPQ_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = PhiNPQ, color = Treatment, group = Pot.number)) + theme_classic()
PhiNPQ_over_time_s <- PhiNPQ_over_time_s + geom_line(alpha = 0.1)
PhiNPQ_over_time_s <- PhiNPQ_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PhiNPQ_over_time_s <- PhiNPQ_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PhiNPQ_over_time_s <- PhiNPQ_over_time_s + scale_color_manual(values = c("blue", "red")) 
PhiNPQ_over_time_s <- PhiNPQ_over_time_s + ylab("PhiNPQ (a.u.)") + ggtitle("PhiNPQ over time - salt v control") + theme(legend.position="bottom") 
PhiNPQ_over_time_s

unique(new_control_salt3$Treatment)
## [1] "Control" "Salt"
PhiNPQ_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = PhiNPQ, na.rm = TRUE, color = Treatment, group = Pot.number)) + theme_classic()
PhiNPQ_over_time_d <- PhiNPQ_over_time_d + geom_line(alpha = 0.1)
PhiNPQ_over_time_d <- PhiNPQ_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PhiNPQ_over_time_d <- PhiNPQ_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PhiNPQ_over_time_d <- PhiNPQ_over_time_d + scale_color_manual(values = c("blue", "red"))
PhiNPQ_over_time_d <- PhiNPQ_over_time_d + ylab("PhiNPQ (a.u.)") + ggtitle("PhiNPQ Over Time - drought v control") + theme(legend.position="bottom")
PhiNPQ_over_time_d

FvP_over_FmP_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = FvP_over_FmP, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
FvP_over_FmP_over_time_s <- FvP_over_FmP_over_time_s + geom_line(alpha = 0.1)
FvP_over_FmP_over_time_s <- FvP_over_FmP_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
FvP_over_FmP_over_time_s <- FvP_over_FmP_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FvP_over_FmP_over_time_s <- FvP_over_FmP_over_time_s + scale_color_manual(values = c("blue", "red"))
FvP_over_FmP_over_time_s <- FvP_over_FmP_over_time_s + ylab("FvP_over_FmP (a.u.)") + ggtitle("FvP over FmP over time - salt v control") + theme(legend.position="bottom")
FvP_over_FmP_over_time_s

FvP_over_FmP_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = FvP_over_FmP, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
FvP_over_FmP_over_time_d <- FvP_over_FmP_over_time_d + geom_line(alpha = 0.1)
FvP_over_FmP_over_time_d <- FvP_over_FmP_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
FvP_over_FmP_over_time_d <- FvP_over_FmP_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FvP_over_FmP_over_time_d <- FvP_over_FmP_over_time_d + scale_color_manual(values = c("blue", "red", "orange"))
FvP_over_FmP_over_time_d <- FvP_over_FmP_over_time_d + ylab("FvP_over_FmP (a.u.)") + ggtitle("FvP over FmP over time - drought v control") + theme(legend.position="bottom")
FvP_over_FmP_over_time_d

PS1.Active.Centers_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = PS1.Active.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Active.Centers_over_time_s <- PS1.Active.Centers_over_time_s + geom_line(alpha = 0.1)
PS1.Active.Centers_over_time_s <- PS1.Active.Centers_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Active.Centers_over_time_s <- PS1.Active.Centers_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Active.Centers_over_time_s <- PS1.Active.Centers_over_time_s + scale_color_manual(values = c("blue", "red"))
PS1.Active.Centers_over_time_s <- PS1.Active.Centers_over_time_s + ylab("PS1.Active.Centers (a.u.)") + ggtitle("PS1.Active.Centers over time - salt v control") + theme(legend.position="bottom")
PS1.Active.Centers_over_time_s
## Warning: Removed 1 rows containing non-finite values (stat_summary).

## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 row(s) containing missing values (geom_path).

PS1.Active.Centers_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = PS1.Active.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Active.Centers_over_time_d <- PS1.Active.Centers_over_time_d + geom_line(alpha = 0.1)
PS1.Active.Centers_over_time_d <- PS1.Active.Centers_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Active.Centers_over_time_d <- PS1.Active.Centers_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Active.Centers_over_time_d <- PS1.Active.Centers_over_time_d + scale_color_manual(values = c("blue", "red"))
PS1.Active.Centers_over_time_d <- PS1.Active.Centers_over_time_d + ylab("PS1.Active.Centers (a.u.)") + ggtitle("PS1.Active.Centers over time - drought v control") + theme(legend.position="bottom")
PS1.Active.Centers_over_time_d
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 row(s) containing missing values (geom_path).

PS1.Open.Centers_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = PS1.Open.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Open.Centers_over_time_s <- PS1.Open.Centers_over_time_s + geom_line(alpha = 0.1)
PS1.Open.Centers_over_time_s <- PS1.Open.Centers_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Open.Centers_over_time_s <- PS1.Open.Centers_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Open.Centers_over_time_s <- PS1.Open.Centers_over_time_s + scale_color_manual(values = c("blue", "red"))
PS1.Open.Centers_over_time_s <- PS1.Open.Centers_over_time_s + ylab("PS1.Open.Centers (a.u.)") + ggtitle("PS1.Open.Centers over time - salt v control") + theme(legend.position="bottom")
PS1.Open.Centers_over_time_s

PS1.Open.Centers_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = PS1.Open.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Open.Centers_over_time_d <- PS1.Open.Centers_over_time_d + geom_line(alpha = 0.1)
PS1.Open.Centers_over_time_d <- PS1.Open.Centers_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Open.Centers_over_time_d <- PS1.Open.Centers_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Open.Centers_over_time_d <- PS1.Open.Centers_over_time_d + scale_color_manual(values = c("blue", "red"))
PS1.Open.Centers_over_time_d <- PS1.Open.Centers_over_time_d + ylab("PS1.Open.Centers (a.u.)") + ggtitle("PS1.Open.Centers over time - drought v control") + theme(legend.position="bottom")
PS1.Open.Centers_over_time_d

SPAD_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = SPAD, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
SPAD_over_time_s <- SPAD_over_time_s + geom_line(alpha = 0.1)
SPAD_over_time_s <- SPAD_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
SPAD_over_time_s <- SPAD_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
SPAD_over_time_s <- SPAD_over_time_s + scale_color_manual(values = c("blue", "red"))
SPAD_over_time_s <- SPAD_over_time_s + ylab("SPAD (a.u.)") + ggtitle("SPAD over time - salt v control") + theme(legend.position="bottom")
SPAD_over_time_s

SPAD_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = SPAD, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
SPAD_over_time_d <- SPAD_over_time_d + geom_line(alpha = 0.1)
SPAD_over_time_d <- SPAD_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
SPAD_over_time_d <- SPAD_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
SPAD_over_time_d <- SPAD_over_time_d + scale_color_manual(values = c("blue", "red"))
SPAD_over_time_d <- SPAD_over_time_d + ylab("SPAD (a.u.)") + ggtitle("SPAD over time - drought v control") + theme(legend.position="bottom")
SPAD_over_time_d

PS1.Oxidized.Centers_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = PS1.Oxidized.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Oxidized.Centers_over_time_d <- PS1.Oxidized.Centers_over_time_d + geom_line(alpha = 0.1)
PS1.Oxidized.Centers_over_time_d <- PS1.Oxidized.Centers_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Oxidized.Centers_over_time_d <- PS1.Oxidized.Centers_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Oxidized.Centers_over_time_d <- PS1.Oxidized.Centers_over_time_d + scale_color_manual(values = c("blue", "red"))
PS1.Oxidized.Centers_over_time_d <- PS1.Oxidized.Centers_over_time_d + ylab("PS1.Oxidized.Centers (a.u.)") + ggtitle("PS1.Oxidized.Centers Over Time - drought v control") + theme(legend.position="bottom")
PS1.Oxidized.Centers_over_time_d

PS1.Oxidized.Centers_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = PS1.Oxidized.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Oxidized.Centers_over_time_s <- PS1.Oxidized.Centers_over_time_s + geom_line(alpha = 0.1)
PS1.Oxidized.Centers_over_time_s <- PS1.Oxidized.Centers_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Oxidized.Centers_over_time_s <- PS1.Oxidized.Centers_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Oxidized.Centers_over_time_s <- PS1.Oxidized.Centers_over_time_s + scale_color_manual(values = c("blue", "red"))
PS1.Oxidized.Centers_over_time_s <- PS1.Oxidized.Centers_over_time_s + ylab("PS1.Oxidized.Centers (a.u.)") + ggtitle("PS1.Oxidized.Centers Over Time - salt v control") + theme(legend.position="bottom")
PS1.Oxidized.Centers_over_time_s

PS1.Over.Reduced.Centers_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = PS1.Over.Reduced.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Over.Reduced.Centers_over_time_d <- PS1.Over.Reduced.Centers_over_time_d + geom_line(alpha = 0.1)
PS1.Over.Reduced.Centers_over_time_d <- PS1.Over.Reduced.Centers_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Over.Reduced.Centers_over_time_d <- PS1.Over.Reduced.Centers_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Over.Reduced.Centers_over_time_d <- PS1.Over.Reduced.Centers_over_time_d + scale_color_manual(values = c("blue", "red"))
PS1.Over.Reduced.Centers_over_time_d <- PS1.Over.Reduced.Centers_over_time_d + ylab("PS1.Over.Reduced.Centers (a.u.)") + ggtitle("PS1.Over.Reduced.Centers Over Time - drought v control") + theme(legend.position="bottom")
PS1.Over.Reduced.Centers_over_time_d

PS1.Over.Reduced.Centers_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = PS1.Over.Reduced.Centers, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
PS1.Over.Reduced.Centers_over_time_s <- PS1.Over.Reduced.Centers_over_time_s + geom_line(alpha = 0.1)
PS1.Over.Reduced.Centers_over_time_s <- PS1.Over.Reduced.Centers_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
PS1.Over.Reduced.Centers_over_time_s <- PS1.Over.Reduced.Centers_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
PS1.Over.Reduced.Centers_over_time_s <- PS1.Over.Reduced.Centers_over_time_s + scale_color_manual(values = c("blue", "red"))
PS1.Over.Reduced.Centers_over_time_s <- PS1.Over.Reduced.Centers_over_time_s + ylab("PS1.Oxidized.Centers (a.u.)") + ggtitle("PS1.Over.Reduced.Centers Over Time - salt v control") + theme(legend.position="bottom")
PS1.Over.Reduced.Centers_over_time_s

leaf_thickness_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = leaf_thickness, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
leaf_thickness_over_time_d <- leaf_thickness_over_time_d + geom_line(alpha = 0.1)
leaf_thickness_over_time_d <- leaf_thickness_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
leaf_thickness_over_time_d <- leaf_thickness_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
leaf_thickness_over_time_d <- leaf_thickness_over_time_d + scale_color_manual(values = c("blue", "red"))
leaf_thickness_over_time_d <- leaf_thickness_over_time_d + ylab("leaf_thickness (mm?)") + ggtitle("Leaf Thickness over time - drought v control") + theme(legend.position="bottom")
leaf_thickness_over_time_d
## Warning: Removed 1 rows containing non-finite values (stat_summary).

## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 row(s) containing missing values (geom_path).

leaf_thickness_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = leaf_thickness, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
leaf_thickness_over_time_s <- leaf_thickness_over_time_s + geom_line(alpha = 0.1)
leaf_thickness_over_time_s <- leaf_thickness_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
leaf_thickness_over_time_s <- leaf_thickness_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
leaf_thickness_over_time_s <- leaf_thickness_over_time_s + scale_color_manual(values = c("blue", "red"))
leaf_thickness_over_time_s <- leaf_thickness_over_time_s + ylab("leaf_thickness (mm?)") + ggtitle("Leaf Thickness over time - salt v control") +  theme(legend.position="bottom")
leaf_thickness_over_time_s
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).

Leaf.Temperature_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = Leaf.Temperature, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
Leaf.Temperature_over_time_d <- Leaf.Temperature_over_time_d + geom_line(alpha = 0.1)
Leaf.Temperature_over_time_d <- Leaf.Temperature_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
Leaf.Temperature_over_time_d <- Leaf.Temperature_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
Leaf.Temperature_over_time_d <- Leaf.Temperature_over_time_d + scale_color_manual(values = c("blue", "red"))
Leaf.Temperature_over_time_d <- Leaf.Temperature_over_time_d + ylab("Leaf.Temperature (C)") + ggtitle("Leaf Temperature Over Time - drought v control") + theme(legend.position="bottom")
Leaf.Temperature_over_time_d

Leaf.Temperature_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = Leaf.Temperature, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
Leaf.Temperature_over_time_s <- Leaf.Temperature_over_time_s + geom_line(alpha = 0.1)
Leaf.Temperature_over_time_s <- Leaf.Temperature_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
Leaf.Temperature_over_time_s <- Leaf.Temperature_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
Leaf.Temperature_over_time_s <- Leaf.Temperature_over_time_s + scale_color_manual(values = c("blue", "red"))
Leaf.Temperature_over_time_s <- Leaf.Temperature_over_time_s + ylab("Leaf.Temperature (C)") + ggtitle("Leaf Temperature Over Time - salt v control") + theme(legend.position="bottom")
Leaf.Temperature_over_time_s

FmPrime_over_time_s <- ggplot(data = new_control_salt3, aes(x = Day, y = FmPrime, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
FmPrime_over_time_s <- FmPrime_over_time_s + geom_line(alpha = 0.1)
FmPrime_over_time_s <- FmPrime_over_time_s + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
FmPrime_over_time_s <- FmPrime_over_time_s + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FmPrime_over_time_s <- FmPrime_over_time_s + scale_color_manual(values = c("blue", "red"))
FmPrime_over_time_s <- FmPrime_over_time_s + ylab("FmPrime (a.u.)") + ggtitle("FmPrime Over Time - salt v control") + theme(legend.position="bottom")
FmPrime_over_time_s

FmPrime_over_time_d <- ggplot(data = new_control_drought3, aes(x = Day, y = FmPrime, na.rm = TRUE, group = Pot.number, color = Treatment)) + theme_classic()
FmPrime_over_time_d <- FmPrime_over_time_d + geom_line(alpha = 0.1)
FmPrime_over_time_d <- FmPrime_over_time_d + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "solid")
FmPrime_over_time_d <- FmPrime_over_time_d + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = T)
FmPrime_over_time_d <- FmPrime_over_time_d + scale_color_manual(values = c("blue", "red"))
FmPrime_over_time_d <- FmPrime_over_time_d + ylab("FmPrime (a.u.)") + ggtitle("FmPrime Over Time - drought v control") + theme(legend.position="bottom")
FmPrime_over_time_d

Photosyn_geno2
unique(Photosyn_geno2$Day)
## [1] 13 10 8  5  2  0  -2
## Levels: -2 0 2 5 8 10 13

Below I started by finding the average of each treatment on a given day. I faceted by genotype to compare each genotype to this overall average

#comparing accessions to overall average, subset per day, facet by treatment 

unique(Photosyn_geno2$Day)
## [1] 13 10 8  5  2  0  -2
## Levels: -2 0 2 5 8 10 13
Photosyn_geno2_dneg2 <- subset(Photosyn_geno2, Photosyn_geno2$Day == -2)
Photosyn_geno2_d0 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 0)
Photosyn_geno2_d2 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 2)
Photosyn_geno2_d5 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 5)
Photosyn_geno2_d8 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 8)
Photosyn_geno2_d10 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 10)
Photosyn_geno2_d13 <- subset(Photosyn_geno2, Photosyn_geno2$Day == 13)
#when finding mean, find mean per treatment and use data for each day
FoPrime_mean_dneg2 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
FoPrime_mean_d0 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
FoPrime_mean_d2 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
FoPrime_mean_d5 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
FoPrime_mean_d8 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
FoPrime_mean_d10 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
FoPrime_mean_d13 <- aggregate(FoPrime ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)
FoPrime_mean_d13
#Plots comparing accessions to overall average on a specified day, faceted by treatment
FoPrime_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_dneg2_mean_by_all <- FoPrime_dneg2_mean_by_all + geom_hline(
  data = FoPrime_mean_dneg2, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_dneg2_mean_by_all <- FoPrime_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_dneg2_mean_by_all <- FoPrime_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_dneg2_mean_by_all

FoPrime_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d0_mean_by_all <- FoPrime_d0_mean_by_all + geom_hline(
  data = FoPrime_mean_d0, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d0_mean_by_all <- FoPrime_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d0_mean_by_all <- FoPrime_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d0_mean_by_all

FoPrime_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d2_mean_by_all <- FoPrime_d2_mean_by_all + geom_hline(
  data = FoPrime_mean_d2, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d2_mean_by_all <- FoPrime_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d2_mean_by_all <- FoPrime_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d2_mean_by_all

FoPrime_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d5_mean_by_all <- FoPrime_d5_mean_by_all + geom_hline(
  data = FoPrime_mean_d5, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d5_mean_by_all <- FoPrime_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d5_mean_by_all <- FoPrime_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d5_mean_by_all

FoPrime_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d8_mean_by_all <- FoPrime_d8_mean_by_all + geom_hline(
  data = FoPrime_mean_d8, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d8_mean_by_all <- FoPrime_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d8_mean_by_all <- FoPrime_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d8_mean_by_all

FoPrime_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d10_mean_by_all <- FoPrime_d10_mean_by_all + geom_hline(
  data = FoPrime_mean_d10, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d10_mean_by_all <- FoPrime_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d10_mean_by_all <- FoPrime_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d10_mean_by_all

FoPrime_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "FoPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FoPrime")
FoPrime_d13_mean_by_all <- FoPrime_d13_mean_by_all + geom_hline(
  data = FoPrime_mean_d13, aes(yintercept = FoPrime),
  linetype = 2,
  group = "Day")
FoPrime_d13_mean_by_all <- FoPrime_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FoPrime_d13_mean_by_all <- FoPrime_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FoPrime_d13_mean_by_all

#PhiNPQ
PhiNPQ_mean_dneg2 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
PhiNPQ_mean_d0 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
PhiNPQ_mean_d2 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
PhiNPQ_mean_d5 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
PhiNPQ_mean_d8 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
PhiNPQ_mean_d10 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
PhiNPQ_mean_d13 <- aggregate(PhiNPQ ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

PhiNPQ_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_dneg2_mean_by_all <- PhiNPQ_dneg2_mean_by_all + geom_hline(
  data = PhiNPQ_mean_dneg2, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_dneg2_mean_by_all <- PhiNPQ_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_dneg2_mean_by_all <- PhiNPQ_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_dneg2_mean_by_all

PhiNPQ_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d0_mean_by_all <- PhiNPQ_d0_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d0, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d0_mean_by_all <- PhiNPQ_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d0_mean_by_all <- PhiNPQ_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d0_mean_by_all

PhiNPQ_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d2_mean_by_all <- PhiNPQ_d2_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d2, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d2_mean_by_all <- PhiNPQ_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d2_mean_by_all <- PhiNPQ_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d2_mean_by_all

PhiNPQ_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d5_mean_by_all <- PhiNPQ_d5_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d5, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d5_mean_by_all <- PhiNPQ_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d5_mean_by_all <- PhiNPQ_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d5_mean_by_all

PhiNPQ_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d8_mean_by_all <- PhiNPQ_d8_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d8, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d8_mean_by_all <- PhiNPQ_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d8_mean_by_all <- PhiNPQ_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d8_mean_by_all

PhiNPQ_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d10_mean_by_all <- PhiNPQ_d10_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d10, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d10_mean_by_all <- PhiNPQ_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d10_mean_by_all <- PhiNPQ_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d10_mean_by_all

PhiNPQ_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "PhiNPQ", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PhiNPQ")
PhiNPQ_d13_mean_by_all <- PhiNPQ_d13_mean_by_all + geom_hline(
  data = PhiNPQ_mean_d13, aes(yintercept = PhiNPQ),
  linetype = 2,
  group = "Day")
PhiNPQ_d13_mean_by_all <- PhiNPQ_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PhiNPQ_d13_mean_by_all <- PhiNPQ_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PhiNPQ_d13_mean_by_all

#FvP_over_FmP
FvP_over_FmP_mean_dneg2 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
FvP_over_FmP_mean_d0 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
FvP_over_FmP_mean_d2 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
FvP_over_FmP_mean_d5 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
FvP_over_FmP_mean_d8 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
FvP_over_FmP_mean_d10 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
FvP_over_FmP_mean_d13 <- aggregate(FvP_over_FmP ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

FvP_over_FmP_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_dneg2_mean_by_all <- FvP_over_FmP_dneg2_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_dneg2, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_dneg2_mean_by_all <- FvP_over_FmP_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_dneg2_mean_by_all <- FvP_over_FmP_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_dneg2_mean_by_all

FvP_over_FmP_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d0_mean_by_all <- FvP_over_FmP_d0_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d0, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d0_mean_by_all <- FvP_over_FmP_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d0_mean_by_all <- FvP_over_FmP_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d0_mean_by_all

FvP_over_FmP_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d2_mean_by_all <- FvP_over_FmP_d2_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d2, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d2_mean_by_all <- FvP_over_FmP_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d2_mean_by_all <- FvP_over_FmP_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d2_mean_by_all

FvP_over_FmP_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d5_mean_by_all <- FvP_over_FmP_d5_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d5, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d5_mean_by_all <- FvP_over_FmP_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d5_mean_by_all <- FvP_over_FmP_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d5_mean_by_all

FvP_over_FmP_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d8_mean_by_all <- FvP_over_FmP_d8_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d8, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d8_mean_by_all <- FvP_over_FmP_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d8_mean_by_all <- FvP_over_FmP_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d8_mean_by_all

FvP_over_FmP_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d10_mean_by_all <- FvP_over_FmP_d10_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d10, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d10_mean_by_all <- FvP_over_FmP_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d10_mean_by_all <- FvP_over_FmP_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d10_mean_by_all

FvP_over_FmP_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "FvP_over_FmP", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FvP_over_FmP")
FvP_over_FmP_d13_mean_by_all <- FvP_over_FmP_d13_mean_by_all + geom_hline(
  data = FvP_over_FmP_mean_d13, aes(yintercept = FvP_over_FmP),
  linetype = 2,
  group = "Day")
FvP_over_FmP_d13_mean_by_all <- FvP_over_FmP_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FvP_over_FmP_d13_mean_by_all <- FvP_over_FmP_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FvP_over_FmP_d13_mean_by_all

#FmPrime
FmPrime_mean_dneg2 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
FmPrime_mean_d0 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
FmPrime_mean_d2 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
FmPrime_mean_d5 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
FmPrime_mean_d8 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
FmPrime_mean_d10 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
FmPrime_mean_d13 <- aggregate(FmPrime ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

FmPrime_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_dneg2_mean_by_all <- FmPrime_dneg2_mean_by_all + geom_hline(
  data = FmPrime_mean_dneg2, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_dneg2_mean_by_all <- FmPrime_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_dneg2_mean_by_all <- FmPrime_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_dneg2_mean_by_all

FmPrime_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d0_mean_by_all <- FmPrime_d0_mean_by_all + geom_hline(
  data = FmPrime_mean_d0, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d0_mean_by_all <- FmPrime_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d0_mean_by_all <- FmPrime_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d0_mean_by_all

FmPrime_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d2_mean_by_all <- FmPrime_d2_mean_by_all + geom_hline(
  data = FmPrime_mean_d2, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d2_mean_by_all <- FmPrime_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d2_mean_by_all <- FmPrime_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d2_mean_by_all

FmPrime_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d5_mean_by_all <- FmPrime_d5_mean_by_all + geom_hline(
  data = FmPrime_mean_d5, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d5_mean_by_all <- FmPrime_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d5_mean_by_all <- FmPrime_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d5_mean_by_all

FmPrime_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d8_mean_by_all <- FmPrime_d8_mean_by_all + geom_hline(
  data = FmPrime_mean_d8, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d8_mean_by_all <- FmPrime_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d8_mean_by_all <- FmPrime_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d8_mean_by_all

FmPrime_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d10_mean_by_all <- FmPrime_d10_mean_by_all + geom_hline(
  data = FmPrime_mean_d10, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d10_mean_by_all <- FmPrime_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d10_mean_by_all <- FmPrime_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d10_mean_by_all

FmPrime_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "FmPrime", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "FmPrime")
FmPrime_d13_mean_by_all <- FmPrime_d13_mean_by_all + geom_hline(
  data = FmPrime_mean_d13, aes(yintercept = FmPrime),
  linetype = 2,
  group = "Day")
FmPrime_d13_mean_by_all <- FmPrime_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
FmPrime_d13_mean_by_all <- FmPrime_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
FmPrime_d13_mean_by_all

#PS1.Active.Centers
PS1.Active.Centers_mean_dneg2 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
PS1.Active.Centers_mean_d0 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
PS1.Active.Centers_mean_d2 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
PS1.Active.Centers_mean_d5 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
PS1.Active.Centers_mean_d8 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
PS1.Active.Centers_mean_d10 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
PS1.Active.Centers_mean_d13 <- aggregate(PS1.Active.Centers ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

PS1.Active.Centers_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_dneg2_mean_by_all <- PS1.Active.Centers_dneg2_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_dneg2, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_dneg2_mean_by_all <- PS1.Active.Centers_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_dneg2_mean_by_all <- PS1.Active.Centers_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_dneg2_mean_by_all
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 rows containing missing values (geom_point).

PS1.Active.Centers_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d0_mean_by_all <- PS1.Active.Centers_d0_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d0, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d0_mean_by_all <- PS1.Active.Centers_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d0_mean_by_all <- PS1.Active.Centers_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d0_mean_by_all

PS1.Active.Centers_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d2_mean_by_all <- PS1.Active.Centers_d2_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d2, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d2_mean_by_all <- PS1.Active.Centers_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d2_mean_by_all <- PS1.Active.Centers_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d2_mean_by_all

PS1.Active.Centers_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d5_mean_by_all <- PS1.Active.Centers_d5_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d5, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d5_mean_by_all <- PS1.Active.Centers_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d5_mean_by_all <- PS1.Active.Centers_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d5_mean_by_all

PS1.Active.Centers_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d8_mean_by_all <- PS1.Active.Centers_d8_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d8, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d8_mean_by_all <- PS1.Active.Centers_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d8_mean_by_all <- PS1.Active.Centers_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d8_mean_by_all

PS1.Active.Centers_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d10_mean_by_all <- PS1.Active.Centers_d10_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d10, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d10_mean_by_all <- PS1.Active.Centers_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d10_mean_by_all <- PS1.Active.Centers_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d10_mean_by_all

PS1.Active.Centers_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "PS1.Active.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Active.Centers")
PS1.Active.Centers_d13_mean_by_all <- PS1.Active.Centers_d13_mean_by_all + geom_hline(
  data = PS1.Active.Centers_mean_d13, aes(yintercept = PS1.Active.Centers),
  linetype = 2,
  group = "Day")
PS1.Active.Centers_d13_mean_by_all <- PS1.Active.Centers_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Active.Centers_d13_mean_by_all <- PS1.Active.Centers_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Active.Centers_d13_mean_by_all

#PS1.Open.Centers
PS1.Open.Centers_mean_dneg2 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
PS1.Open.Centers_mean_d0 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
PS1.Open.Centers_mean_d2 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
PS1.Open.Centers_mean_d5 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
PS1.Open.Centers_mean_d8 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
PS1.Open.Centers_mean_d10 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
PS1.Open.Centers_mean_d13 <- aggregate(PS1.Open.Centers ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

PS1.Open.Centers_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_dneg2_mean_by_all <- PS1.Open.Centers_dneg2_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_dneg2, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_dneg2_mean_by_all <- PS1.Open.Centers_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_dneg2_mean_by_all <- PS1.Open.Centers_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_dneg2_mean_by_all

PS1.Open.Centers_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d0_mean_by_all <- PS1.Open.Centers_d0_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d0, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d0_mean_by_all <- PS1.Open.Centers_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d0_mean_by_all <- PS1.Open.Centers_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d0_mean_by_all

PS1.Open.Centers_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d2_mean_by_all <- PS1.Open.Centers_d2_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d2, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d2_mean_by_all <- PS1.Open.Centers_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d2_mean_by_all <- PS1.Open.Centers_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d2_mean_by_all

PS1.Open.Centers_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d5_mean_by_all <- PS1.Open.Centers_d5_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d5, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d5_mean_by_all <- PS1.Open.Centers_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d5_mean_by_all <- PS1.Open.Centers_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d5_mean_by_all

PS1.Open.Centers_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d8_mean_by_all <- PS1.Open.Centers_d8_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d8, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d8_mean_by_all <- PS1.Open.Centers_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d8_mean_by_all <- PS1.Open.Centers_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d8_mean_by_all

PS1.Open.Centers_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d10_mean_by_all <- PS1.Open.Centers_d10_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d10, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d10_mean_by_all <- PS1.Open.Centers_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d10_mean_by_all <- PS1.Open.Centers_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d10_mean_by_all

PS1.Open.Centers_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "PS1.Open.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Open.Centers")
PS1.Open.Centers_d13_mean_by_all <- PS1.Open.Centers_d13_mean_by_all + geom_hline(
  data = PS1.Open.Centers_mean_d13, aes(yintercept = PS1.Open.Centers),
  linetype = 2,
  group = "Day")
PS1.Open.Centers_d13_mean_by_all <- PS1.Open.Centers_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Open.Centers_d13_mean_by_all <- PS1.Open.Centers_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Open.Centers_d13_mean_by_all

#PS1.Over.Reduced.Centers
PS1.Over.Reduced.Centers_mean_dneg2 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
PS1.Over.Reduced.Centers_mean_d0 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
PS1.Over.Reduced.Centers_mean_d2 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
PS1.Over.Reduced.Centers_mean_d5 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
PS1.Over.Reduced.Centers_mean_d8 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
PS1.Over.Reduced.Centers_mean_d10 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
PS1.Over.Reduced.Centers_mean_d13 <- aggregate(PS1.Over.Reduced.Centers ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

PS1.Over.Reduced.Centers_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_dneg2_mean_by_all <- PS1.Over.Reduced.Centers_dneg2_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_dneg2, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_dneg2_mean_by_all <- PS1.Over.Reduced.Centers_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_dneg2_mean_by_all <- PS1.Over.Reduced.Centers_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_dneg2_mean_by_all

PS1.Over.Reduced.Centers_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d0_mean_by_all <- PS1.Over.Reduced.Centers_d0_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d0, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d0_mean_by_all <- PS1.Over.Reduced.Centers_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d0_mean_by_all <- PS1.Over.Reduced.Centers_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d0_mean_by_all

PS1.Over.Reduced.Centers_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d2_mean_by_all <- PS1.Over.Reduced.Centers_d2_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d2, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d2_mean_by_all <- PS1.Over.Reduced.Centers_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d2_mean_by_all <- PS1.Over.Reduced.Centers_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d2_mean_by_all

PS1.Over.Reduced.Centers_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d5_mean_by_all <- PS1.Over.Reduced.Centers_d5_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d5, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d5_mean_by_all <- PS1.Over.Reduced.Centers_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d5_mean_by_all <- PS1.Over.Reduced.Centers_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d5_mean_by_all

PS1.Over.Reduced.Centers_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d8_mean_by_all <- PS1.Over.Reduced.Centers_d8_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d8, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d8_mean_by_all <- PS1.Over.Reduced.Centers_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d8_mean_by_all <- PS1.Over.Reduced.Centers_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d8_mean_by_all

PS1.Over.Reduced.Centers_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d10_mean_by_all <- PS1.Over.Reduced.Centers_d10_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d10, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d10_mean_by_all <- PS1.Over.Reduced.Centers_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d10_mean_by_all <- PS1.Over.Reduced.Centers_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d10_mean_by_all

PS1.Over.Reduced.Centers_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "PS1.Over.Reduced.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Over.Reduced.Centers")
PS1.Over.Reduced.Centers_d13_mean_by_all <- PS1.Over.Reduced.Centers_d13_mean_by_all + geom_hline(
  data = PS1.Over.Reduced.Centers_mean_d13, aes(yintercept = PS1.Over.Reduced.Centers),
  linetype = 2,
  group = "Day")
PS1.Over.Reduced.Centers_d13_mean_by_all <- PS1.Over.Reduced.Centers_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Over.Reduced.Centers_d13_mean_by_all <- PS1.Over.Reduced.Centers_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Over.Reduced.Centers_d13_mean_by_all

#PS1.Oxidized.Centers
PS1.Oxidized.Centers_mean_dneg2 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
PS1.Oxidized.Centers_mean_d0 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
PS1.Oxidized.Centers_mean_d2 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
PS1.Oxidized.Centers_mean_d5 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
PS1.Oxidized.Centers_mean_d8 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
PS1.Oxidized.Centers_mean_d10 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
PS1.Oxidized.Centers_mean_d13 <- aggregate(PS1.Oxidized.Centers ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

PS1.Oxidized.Centers_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_dneg2_mean_by_all <- PS1.Oxidized.Centers_dneg2_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_dneg2, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_dneg2_mean_by_all <- PS1.Oxidized.Centers_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_dneg2_mean_by_all <- PS1.Oxidized.Centers_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_dneg2_mean_by_all

PS1.Oxidized.Centers_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d0_mean_by_all <- PS1.Oxidized.Centers_d0_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d0, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d0_mean_by_all <- PS1.Oxidized.Centers_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d0_mean_by_all <- PS1.Oxidized.Centers_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d0_mean_by_all

PS1.Oxidized.Centers_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d2_mean_by_all <- PS1.Oxidized.Centers_d2_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d2, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d2_mean_by_all <- PS1.Oxidized.Centers_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d2_mean_by_all <- PS1.Oxidized.Centers_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d2_mean_by_all

PS1.Oxidized.Centers_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d5_mean_by_all <- PS1.Oxidized.Centers_d5_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d5, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d5_mean_by_all <- PS1.Oxidized.Centers_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d5_mean_by_all <- PS1.Oxidized.Centers_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d5_mean_by_all

PS1.Oxidized.Centers_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d8_mean_by_all <- PS1.Oxidized.Centers_d8_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d8, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d8_mean_by_all <- PS1.Oxidized.Centers_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d8_mean_by_all <- PS1.Oxidized.Centers_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d8_mean_by_all

PS1.Oxidized.Centers_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d10_mean_by_all <- PS1.Oxidized.Centers_d10_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d10, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d10_mean_by_all <- PS1.Oxidized.Centers_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d10_mean_by_all <- PS1.Oxidized.Centers_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d10_mean_by_all

PS1.Oxidized.Centers_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "PS1.Oxidized.Centers", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "PS1.Oxidized.Centers")
PS1.Oxidized.Centers_d13_mean_by_all <- PS1.Oxidized.Centers_d13_mean_by_all + geom_hline(
  data = PS1.Oxidized.Centers_mean_d13, aes(yintercept = PS1.Oxidized.Centers),
  linetype = 2,
  group = "Day")
PS1.Oxidized.Centers_d13_mean_by_all <- PS1.Oxidized.Centers_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
PS1.Oxidized.Centers_d13_mean_by_all <- PS1.Oxidized.Centers_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
PS1.Oxidized.Centers_d13_mean_by_all

#leaf_thickness
leaf_thickness_mean_dneg2 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
leaf_thickness_mean_d0 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
leaf_thickness_mean_d2 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
leaf_thickness_mean_d5 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
leaf_thickness_mean_d8 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
leaf_thickness_mean_d10 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
leaf_thickness_mean_d13 <- aggregate(leaf_thickness ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

leaf_thickness_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_dneg2_mean_by_all <- leaf_thickness_dneg2_mean_by_all + geom_hline(
  data = leaf_thickness_mean_dneg2, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_dneg2_mean_by_all <- leaf_thickness_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_dneg2_mean_by_all <- leaf_thickness_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_dneg2_mean_by_all

leaf_thickness_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d0_mean_by_all <- leaf_thickness_d0_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d0, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d0_mean_by_all <- leaf_thickness_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d0_mean_by_all <- leaf_thickness_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d0_mean_by_all

leaf_thickness_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d2_mean_by_all <- leaf_thickness_d2_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d2, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d2_mean_by_all <- leaf_thickness_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d2_mean_by_all <- leaf_thickness_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d2_mean_by_all

leaf_thickness_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d5_mean_by_all <- leaf_thickness_d5_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d5, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d5_mean_by_all <- leaf_thickness_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d5_mean_by_all <- leaf_thickness_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d5_mean_by_all

leaf_thickness_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d8_mean_by_all <- leaf_thickness_d8_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d8, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d8_mean_by_all <- leaf_thickness_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d8_mean_by_all <- leaf_thickness_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d8_mean_by_all
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 rows containing missing values (geom_point).

leaf_thickness_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d10_mean_by_all <- leaf_thickness_d10_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d10, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d10_mean_by_all <- leaf_thickness_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d10_mean_by_all <- leaf_thickness_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d10_mean_by_all

leaf_thickness_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "leaf_thickness", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "leaf_thickness")
leaf_thickness_d13_mean_by_all <- leaf_thickness_d13_mean_by_all + geom_hline(
  data = leaf_thickness_mean_d13, aes(yintercept = leaf_thickness),
  linetype = 2,
  group = "Day")
leaf_thickness_d13_mean_by_all <- leaf_thickness_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
leaf_thickness_d13_mean_by_all <- leaf_thickness_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
leaf_thickness_d13_mean_by_all
## Warning: Removed 1 rows containing non-finite values (stat_summary).
## Warning: Removed 1 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1 rows containing missing values (geom_point).

#Leaf.Temperature
Leaf.Temperature_mean_dneg2 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
Leaf.Temperature_mean_d0 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
Leaf.Temperature_mean_d2 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
Leaf.Temperature_mean_d5 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
Leaf.Temperature_mean_d8 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
Leaf.Temperature_mean_d10 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
Leaf.Temperature_mean_d13 <- aggregate(Leaf.Temperature ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

Leaf.Temperature_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_dneg2_mean_by_all <- Leaf.Temperature_dneg2_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_dneg2, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_dneg2_mean_by_all <- Leaf.Temperature_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_dneg2_mean_by_all <- Leaf.Temperature_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_dneg2_mean_by_all

Leaf.Temperature_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d0_mean_by_all <- Leaf.Temperature_d0_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d0, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d0_mean_by_all <- Leaf.Temperature_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d0_mean_by_all <- Leaf.Temperature_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d0_mean_by_all

Leaf.Temperature_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d2_mean_by_all <- Leaf.Temperature_d2_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d2, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d2_mean_by_all <- Leaf.Temperature_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d2_mean_by_all <- Leaf.Temperature_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d2_mean_by_all

Leaf.Temperature_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d5_mean_by_all <- Leaf.Temperature_d5_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d5, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d5_mean_by_all <- Leaf.Temperature_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d5_mean_by_all <- Leaf.Temperature_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d5_mean_by_all

Leaf.Temperature_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d8_mean_by_all <- Leaf.Temperature_d8_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d8, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d8_mean_by_all <- Leaf.Temperature_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d8_mean_by_all <- Leaf.Temperature_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d8_mean_by_all

Leaf.Temperature_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d10_mean_by_all <- Leaf.Temperature_d10_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d10, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d10_mean_by_all <- Leaf.Temperature_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d10_mean_by_all <- Leaf.Temperature_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d10_mean_by_all

Leaf.Temperature_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "Leaf.Temperature", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "Leaf.Temperature")
Leaf.Temperature_d13_mean_by_all <- Leaf.Temperature_d13_mean_by_all + geom_hline(
  data = Leaf.Temperature_mean_d13, aes(yintercept = Leaf.Temperature),
  linetype = 2,
  group = "Day")
Leaf.Temperature_d13_mean_by_all <- Leaf.Temperature_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
Leaf.Temperature_d13_mean_by_all <- Leaf.Temperature_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
Leaf.Temperature_d13_mean_by_all

#SPAD
SPAD_mean_dneg2 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_dneg2, FUN = mean)
SPAD_mean_d0 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d0, FUN = mean)
SPAD_mean_d2 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d2, FUN = mean)
SPAD_mean_d5 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d5, FUN = mean)
SPAD_mean_d8 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d8, FUN = mean)
SPAD_mean_d10 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d10, FUN = mean)
SPAD_mean_d13 <- aggregate(SPAD ~ Treatment, data = Photosyn_geno2_d13, FUN = mean)

SPAD_dneg2_mean_by_all <- ggerrorplot(Photosyn_geno2_dneg2, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_dneg2_mean_by_all <- SPAD_dneg2_mean_by_all + geom_hline(
  data = SPAD_mean_dneg2, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_dneg2_mean_by_all <- SPAD_dneg2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_dneg2_mean_by_all <- SPAD_dneg2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_dneg2_mean_by_all

SPAD_d0_mean_by_all <- ggerrorplot(Photosyn_geno2_d0, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d0_mean_by_all <- SPAD_d0_mean_by_all + geom_hline(
  data = SPAD_mean_d0, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d0_mean_by_all <- SPAD_d0_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d0_mean_by_all <- SPAD_d0_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d0_mean_by_all

SPAD_d2_mean_by_all <- ggerrorplot(Photosyn_geno2_d2, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d2_mean_by_all <- SPAD_d2_mean_by_all + geom_hline(
  data = SPAD_mean_d2, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d2_mean_by_all <- SPAD_d2_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d2_mean_by_all <- SPAD_d2_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d2_mean_by_all

SPAD_d5_mean_by_all <- ggerrorplot(Photosyn_geno2_d5, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d5_mean_by_all <- SPAD_d5_mean_by_all + geom_hline(
  data = SPAD_mean_d5, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d5_mean_by_all <- SPAD_d5_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d5_mean_by_all <- SPAD_d5_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d5_mean_by_all

SPAD_d8_mean_by_all <- ggerrorplot(Photosyn_geno2_d8, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d8_mean_by_all <- SPAD_d8_mean_by_all + geom_hline(
  data = SPAD_mean_d8, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d8_mean_by_all <- SPAD_d8_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d8_mean_by_all <- SPAD_d8_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d8_mean_by_all

SPAD_d10_mean_by_all <- ggerrorplot(Photosyn_geno2_d10, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d10_mean_by_all <- SPAD_d10_mean_by_all + geom_hline(
  data = SPAD_mean_d10, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d10_mean_by_all <- SPAD_d10_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d10_mean_by_all <- SPAD_d10_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d10_mean_by_all

SPAD_d13_mean_by_all <- ggerrorplot(Photosyn_geno2_d13, y = "SPAD", x = "genotype", na.rm = TRUE, fill = "genotype", color = "genotype", 
                                            facet.by = c("Day", "Treatment"), ncol = 4,
                                            desc_stat = "mean_sd", add = "jitter",
                                            add.params = list(color = "darkgray"),
                                            xlab = "Genotype", ylab = "SPAD")
SPAD_d13_mean_by_all <- SPAD_d13_mean_by_all + geom_hline(
  data = SPAD_mean_d13, aes(yintercept = SPAD),
  linetype = 2,
  group = "Day")
SPAD_d13_mean_by_all <- SPAD_d13_mean_by_all + rremove("legend") + stat_compare_means(method = "t.test", ref.group = ".all.", label = "p.signif", hide.ns = TRUE)
SPAD_d13_mean_by_all <- SPAD_d13_mean_by_all + theme(axis.text.x = element_text(angle = 90))
SPAD_d13_mean_by_all