Cowpea screen #4 watering was tracked from May 5th thorugh May 19th, 2022. This is to analyze the FW, DW, WC and evapotranspiration of the accessions in this set.

list.files(pattern = ".csv")
## [1] "cowpea_exp4_updated_targets_20220506.csv"
## [2] "exp4_EVT.csv"                            
## [3] "exp4_FW_DW_WC.csv"                       
## [4] "exp4_photosynq.csv"                      
## [5] "exp4_pot_geno.csv"
EVT_exp4 <- read.csv("exp4_EVT.csv")
EVT_exp4
library("ggplot2")
library("reshape2")
library("cowplot")
library("ggpubr")
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:cowplot':
## 
##     get_legend
melt4_EVT <- melt(EVT_exp4, id.vars = c("Pot.number", "Genotype", "Treatment"))

colnames(melt4_EVT)[4] <- "Day"
colnames(melt4_EVT)[5] <- "Evapotranspiration"
melt4_EVT$Day <- gsub("X", "", melt4_EVT$Day)
melt4_EVT$Day <- as.numeric(melt4_EVT$Day)
unique(melt4_EVT$Treatment)
## [1] "Control" "Drought"
melt4_EVT$Treatment <- gsub("Control ", "Control", melt4_EVT$Treatment)
melt4_EVT
melt4_EVT$Evapotranspiration <- as.numeric(melt4_EVT$Evapotranspiration)

melt4_EVTb <- na.omit(melt4_EVT, c("Evapotranspiration"))
#write.csv(melt4_EVTb, "EVT_exp4_melted.csv", row.names = TRUE)

###Plotting of EVT over time

melt4_EVTb$Pot.number <- as.numeric(melt4_EVTb$Pot.number)

EVT4_over_time <- ggplot(data = melt4_EVTb, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT4_over_time <- EVT4_over_time + geom_line(alpha = 0.1)
EVT4_over_time <- EVT4_over_time + stat_summary(fun.data = mean_se, linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "dashed")
EVT4_over_time <- EVT4_over_time + facet_wrap(~ Treatment)
EVT4_over_time <- EVT4_over_time + ylab("Evapotranspiration (g)") + xlab("Day") + rremove("legend")
EVT4_over_time

melt4_EVTb$Day <- as.factor(melt4_EVTb$Day)

EVT4_graph_cd <- ggplot(data = melt4_EVTb, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT4_graph_cd <- EVT4_graph_cd + geom_line(alpha = 0.1)
EVT4_graph_cd <- EVT4_graph_cd + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.1) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "dashed")
EVT4_graph_cd <- EVT4_graph_cd + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = TRUE)
EVT4_graph_cd <- EVT4_graph_cd + scale_color_manual(labels=c("Control", "Drought"), values=c("blue", "red"))
EVT4_graph_cd <- EVT4_graph_cd + ylab("Evapotranspiration (g)") + xlab("Day")
EVT4_graph_cd

length(unique(EVT_exp4$Pot.number))
## [1] 140
dim(EVT_exp4)/140
## [1] 1.0000000 0.1214286
EVT_exp4
dim(melt4_EVT)
## [1] 1960    5

###FW_DW_WC boxplots

list.files(pattern = ".csv")
## [1] "cowpea_exp4_updated_targets_20220506.csv"
## [2] "exp4_EVT.csv"                            
## [3] "exp4_FW_DW_WC.csv"                       
## [4] "exp4_photosynq.csv"                      
## [5] "exp4_pot_geno.csv"
FW_DW4 <- read.csv("exp4_FW_DW_WC.csv")
FW_DW4$FW <- as.numeric(FW_DW4$FW)
FW_DW4$DW <- as.numeric(FW_DW4$DW)
FW_DW4$WC <- as.numeric(FW_DW4$WC)
FW4_by_treatment <- ggboxplot(FW_DW4, x="Treatment", y="FW", add="jitter")
FW4_by_treatment <- FW4_by_treatment + theme(axis.text.x = element_text(angle = 90))
FW4_by_treatment

DW4_by_treatment <- ggboxplot(FW_DW4, x="Treatment", y="DW", add="jitter")
DW4_by_treatment <- DW4_by_treatment + theme(axis.text.x = element_text(angle = 90))
DW4_by_treatment

WC4_by_treatment <- ggboxplot(FW_DW4, x="Treatment", y="WC", add="jitter")
WC4_by_treatment <- WC4_by_treatment + theme(axis.text.x = element_text(angle = 90))
WC4_by_treatment