A note about the EVT values: Some of the plants were accidentally watered by greenhouse staff on 2022/03/03 (day 1), so this analysis will begin with Day 2.
getwd()
## [1] "C:/Users/J Lab/Box/Plant Architecture Lab/Hayley/Cowpea/Cowpea_screen_01_March2022/Cowpea_Phenotype_exp1_analysis"
list.files(pattern = ".csv")
## [1] "EVT.csv"
## [2] "EVT_exp1.csv"
## [3] "FW_DW_watercontent.csv"
## [4] "multispeq_data_exp1.csv"
## [5] "Pot_Geno.csv"
## [6] "watering 3_12-3_17 - Watering Data.csv"
EVT_data <- read.csv("EVT.csv")
EVT_data
library("ggplot2")
library("cowplot")
library("ggpubr")
##
## Attaching package: 'ggpubr'
## The following object is masked from 'package:cowplot':
##
## get_legend
library("reshape2")
melt_EVT <- melt(EVT_data, id.vars = c("Pot.number", "Genotype", "Treatment"))
colnames(melt_EVT)[4] <- "Day"
colnames(melt_EVT)[5] <- "Evapotranspiration"
melt_EVT$Day <- gsub("Day.", "", melt_EVT$Day)
melt_EVT$Day <- as.numeric(melt_EVT$Day)
melt_EVT$Treatment <- gsub("Control ", "Control", melt_EVT$Treatment)
melt_EVT
melt_EVT2 <- subset(melt_EVT, melt_EVT$Day != 1)
melt_EVT2
#checking for irregular EVT values
melt_evt_check <- subset(melt_EVT2, melt_EVT2$Evapotranspiration < 5)
melt_evt_check
#pot 70, day 4 has 1.86 g as EVT. This does not make sense based on EVT for this pot from days before and after. I will exclude this data point as a precaution
melt1_EVT <- subset(melt_EVT2, melt_EVT2$Evapotranspiration != 1.86)
melt1_EVT
#write.csv(melt1_EVT, "EVT_exp1_melted.csv", row.names = TRUE)
###Plotting of EVT over time
melt1_EVT$Pot.number <- as.numeric(melt1_EVT$Pot.number)
EVT1_over_time <- ggplot(data = melt1_EVT, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT1_over_time <- EVT1_over_time + geom_line(alpha = 0.1)
EVT1_over_time <- EVT1_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")
EVT1_over_time <- EVT1_over_time + facet_wrap(~ Treatment)
EVT1_over_time <- EVT1_over_time + ylab("Evapotranspiration (g)") + xlab("Day") + rremove("legend")
EVT1_over_time
melt1_EVT$Day <- as.factor(melt1_EVT$Day)
EVT1_graph_cd <- ggplot(data = melt1_EVT, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT1_graph_cd <- EVT1_graph_cd + geom_line(alpha = 0.1)
EVT1_graph_cd <- EVT1_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")
EVT1_graph_cd <- EVT1_graph_cd + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = TRUE)
EVT1_graph_cd <- EVT1_graph_cd + scale_color_manual(labels=c("Control", "Drought"), values=c("blue", "red"))
EVT1_graph_cd <- EVT1_graph_cd + ylab("Evapotranspiration (g)") + xlab("Day")
EVT1_graph_cd
#install.packages("plotly")
#library(plotly)
#ggplotly(EVT_over_time)
###Fresh/Dry Weights and Water Content Boxplots
FW_DW <- read.csv("FW_DW_watercontent.csv")
colnames(FW_DW)[4] <- "FW"
colnames(FW_DW)[5] <- "DW"
colnames(FW_DW)[6] <- "Water.content"
FW_DW
FW_DW$Treatment <- gsub("Control ", "Control", FW_DW$Treatment)
unique(FW_DW$Treatment)
## [1] "Control" "Drought"
FW_DW$FW <- as.numeric(FW_DW$FW)
FW_DW$DW <- as.numeric(FW_DW$DW)
FW_DW$Water.content <- as.numeric(FW_DW$Water.content)
FW_DW
FW_by_treatment <- ggboxplot(FW_DW, x="Treatment", y="FW", add="jitter")
#FW_by_treatment <- FW_by_treatment + stat_compare_means(aes(group = Treatment),label = "p.signif", method = "t.test", hide.ns = T)
FW_by_treatment <- FW_by_treatment + theme(axis.text.x = element_text(angle = 90))
FW_by_treatment
DW_by_treatment <- ggboxplot(FW_DW, x="Treatment", y="DW", add="jitter")
DW_by_treatment <- DW_by_treatment + theme(axis.text.x = element_text(angle = 90))
DW_by_treatment
Water.content_by_treatment <- ggboxplot(FW_DW, x="Treatment", y="Water.content", add="jitter")
Water.content_by_treatment <- Water.content_by_treatment + theme(axis.text.x = element_text(angle = 90))
Water.content_by_treatment