#Copyright 2019 Daniel Z. Atwater and David C. Haak #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated #documentation files (the "Software"), to deal in the Software without restriction, including #without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the #Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE #WARRANTIES OF MERCHANTABILITY, FITNESS #FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR #COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE #SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ##### INITIALIZE ##### library(car) library(ggplot2) library(grid) library(lme4) library(lmerTest) library(gridExtra) library(multcomp) library(emmeans) ### Set Working Directory ### setwd("~/Google Drive File Stream/My Drive/Shared-Endo-Files") f.normalityplots <- function(a) { par(mfrow = c(2, 2)) plot(a) boxplot(a) hist(a, main = "") qqnorm(a) qqline(a, lty = 2) shapiro.test(a) } f.multiplot <- function(l.plot, s.cols) { require(grid) s.numplots = length(l.plot) layout <- matrix( seq(1, s.cols * ceiling(s.numplots / s.cols)), ncol = s.cols, nrow = ceiling(s.numplots / s.cols) ) grid.newpage() pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout)))) for (i in 1:s.numplots) { matchidx <- as.data.frame(which(layout == i, arr.ind = TRUE)) print( l.plot[[i]], vp = viewport( layout.pos.row = matchidx$row, layout.pos.col = matchidx$col ) ) } } st.dir.kent <- "FAILED/027-MERGED-JGCompetitionSecondTry" st.dir.al <- "044-AlyssaEndo" df.herb <- read.table("044-AlyssaHerb-FINAL.csv", header = T, sep = ",", na.strings = "NA", dec = ".", strip.white = T) df.herb$rep <- factor(df.herb$rep) df.herb$round <- factor(df.herb$round) df.comp <- read.table("044-AlyssaComp-FINAL.csv", header = T, sep = ",", na.strings = ".", dec = ".", strip.white = T) df.comp$rep <- factor(df.comp$rep) df.once <- read.table("044-AlyssaOnce-FINAL.csv", header = T, sep = ",", na.strings = ".", dec = ".", strip.white = T) df.once$rep <- factor(df.once$rep) df.mult <- read.table("044-AlyssaMult-FINAL.csv", header = T, sep = ",", na.strings = ".", dec = ".", strip.white = T) df.mult$rep <- factor(df.mult$rep) m.herb <- lmer(data = df.herb, biomass^(1/2) ~ herb * habitat + l1 + (1|acc) + (1|round) + (1|rep)) anova(m.herb, ddf = "Kenward-Roger") f.normalityplots(resid(m.herb)) m.comp.r <- lmer(data = df.comp[df.comp$tissue == "ROOTS",], biomass^(1/2) ~ comp * habitat + l1 + (1|acc) + (1|rep)) anova(m.comp.r, ddf = "Kenward-Roger") f.normalityplots(resid(m.comp.r)) m.comp.s <- lmer(data = df.comp[df.comp$tissue == "SHOOTS",], biomass^(1/2) ~ comp * habitat + l1 + (1|acc) + (1|rep)) anova(m.comp.s, ddf = "Kenward-Roger") f.normalityplots(resid(m.comp.s)) m.once <- lmer(data = df.once, biomass^(1/2) ~ clip * habitat + l1 + (1|acc) + (1|rep)) anova(m.once, ddf = "Kenward-Roger") f.normalityplots(resid(m.once)) m.mult <- lmer(data = df.mult, biomass^(1/2) ~ clip * habitat + l1 + (1|acc)) anova(m.mult, ddf = "Kenward-Roger") f.normalityplots(resid(m.mult)) m.herb.endo <- lmer(data = df.herb, log(endo) ~ herb * habitat + l1 + (1|acc) + (1|round) + (1|rep)) anova(m.herb.endo, ddf = "Kenward-Roger") f.normalityplots(resid(m.herb.endo)) m.comp.r.endo <- lmer(data = df.comp[df.comp$tissue == "ROOTS",], log(endo) ~ comp * habitat + l1 + (1|acc) + (1|rep)) anova(m.comp.r.endo, ddf = "Kenward-Roger") f.normalityplots(resid(m.comp.r.endo)) m.comp.s.endo <- lmer(data = df.comp[df.comp$tissue == "SHOOTS",], log(endo) ~ comp * habitat + l1 + (1|acc) + (1|rep)) anova(m.comp.s.endo, ddf = "Kenward-Roger") f.normalityplots(resid(m.comp.s.endo)) m.once.endo <- lmer(data = df.once, log(endo) ~ clip * habitat + l1 + (1|acc) + (1|rep)) anova(m.once.endo, ddf = "Kenward-Roger") f.normalityplots(resid(m.once.endo)) m.mult.endo <- lmer(data = df.mult, log(endo) ~ clip * habitat + l1 + (1|acc)) anova(m.mult.endo, ddf = "Kenward-Roger") f.normalityplots(resid(m.mult.endo)) ##Post-hoc tests for group level differences, excluding interactions where primary model dictates. emm.herb=emmeans(m.herb, ~ herb*habitat) pairs(emm.herb, simple = 'each') emm.comp.r=emmeans(m.comp.r, ~ comp * habitat) pairs(emm.comp.r, simple = 'each') emm.comp.s=emmeans(m.comp.s, ~ comp) pairs(emm.comp.s, simple = 'each') emm.once=emmeans(m.once, ~ clip) pairs(emm.once, simple = 'each') emm.mult=emmeans(m.mult, ~ clip*habitat) pairs(emm.mult) emm.herb.endo=emmeans(m.herb.endo, ~ herb + habitat) pairs(emm.herb.endo, simple ='each') emm.comp.r.endo=emmeans(m.comp.r.endo, ~ comp*habitat) pairs(emm.comp.r.endo, simple ='each') ##These are the same as the model...so just a sanity check, they agree with the full models. emm.comp.s.endo=emmeans(m.comp.s.endo, ~ comp) pairs(emm.comp.s.endo, simple = 'each') emm.once.endo=emmeans(m.once.endo, ~ clip) pairs(emm.once.endo, simple = 'each') emm.mult.endo=emmeans(m.mult.endo, ~ clip) pairs(emm.mult.endo, simple = 'each') df.herb$dot.h <- factor(sapply(1:nrow(df.herb), function(i) paste(df.herb[i, "herb"], ".", df.herb[i, "habitat"], sep = ""))) df.comp$dot.h <- factor(sapply(1:nrow(df.comp), function(i) paste(df.comp[i, "comp"], ".", df.comp[i, "habitat"], sep = ""))) df.once$dot.h <- factor(sapply(1:nrow(df.once), function(i) paste(df.once[i, "clip"], ".", df.once[i, "habitat"], sep = ""))) df.mult$dot.h <- factor(sapply(1:nrow(df.mult), function(i) paste(df.mult[i, "clip"], ".", df.mult[i, "habitat"], sep = ""))) df.herb.avg <- do.call(rbind, lapply(unique(df.herb$dot.h), function(i) data.frame( dot.h = i, herb = df.herb[df.herb$dot.h == i, "herb"][1], habitat = df.herb[df.herb$dot.h == i, "habitat"][1], u.log.endo = mean(log(df.herb[df.herb$dot.h == i, "endo"]), na.rm = T), sd.log.endo = sd(log(df.herb[df.herb$dot.h == i, "endo"]), na.rm = T), n.log.endo = sum(is.na(log(df.herb[df.herb$dot.h == i, "endo"])) == F), u.sqrt.mass = mean(df.herb[df.herb$dot.h == i, "biomass"]^(1/2), na.rm = T), sd.sqrt.mass = sd(df.herb[df.herb$dot.h == i, "biomass"]^(1/2), na.rm = T), n.sqrt.mass = sum(is.na(df.herb[df.herb$dot.h == i, "biomass"]^(1/2)) == F) ))) df.herb.avg$se.log.endo <- df.herb.avg$u.log.endo / sqrt(df.herb.avg$n.log.endo) df.herb.avg$se.sqrt.mass <- df.herb.avg$u.sqrt.mass / sqrt(df.herb.avg$n.sqrt.mass) df.herb.avg$h2 <- as.character(df.herb.avg$herb) df.herb.avg$h2[df.herb.avg$h2 == "CONTROL"] <- "a.ctrl" df.herb.avg$h2 <- factor(df.herb.avg$h2) df.comp.s.avg <- do.call(rbind, lapply(unique(df.comp$dot.h), function(i) data.frame( dot.h = i, comp = df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "comp"][1], habitat = df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "habitat"][1], u.log.endo = mean(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "endo"]), na.rm = T), sd.log.endo = sd(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "endo"]), na.rm = T), n.log.endo = sum(is.na(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "endo"])) == F), u.sqrt.mass = mean(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "biomass"]^(1/2), na.rm = T), sd.sqrt.mass = sd(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "biomass"]^(1/2), na.rm = T), n.sqrt.mass = sum(is.na(df.comp[df.comp$dot.h == i & df.comp$tissue == "SHOOTS", "biomass"]^(1/2)) == F) ))) df.comp.s.avg$se.log.endo <- df.comp.s.avg$u.log.endo / sqrt(df.comp.s.avg$n.log.endo) df.comp.s.avg$se.sqrt.mass <- df.comp.s.avg$u.sqrt.mass / sqrt(df.comp.s.avg$n.sqrt.mass) df.comp.s.avg$c2 <- as.character(df.comp.s.avg$comp) df.comp.s.avg$c2[df.comp.s.avg$c2 == "NO"] <- "a.no" df.comp.s.avg$c2 <- factor(df.comp.s.avg$c2) df.comp.r.avg <- do.call(rbind, lapply(unique(df.comp$dot.h), function(i) data.frame( dot.h = i, comp = df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "comp"][1], habitat = df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "habitat"][1], u.log.endo = mean(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "endo"]), na.rm = T), sd.log.endo = sd(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "endo"]), na.rm = T), n.log.endo = sum(is.na(log(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "endo"])) == F), u.sqrt.mass = mean(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "biomass"]^(1/2), na.rm = T), sd.sqrt.mass = sd(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "biomass"]^(1/2), na.rm = T), n.sqrt.mass = sum(is.na(df.comp[df.comp$dot.h == i & df.comp$tissue == "ROOTS", "biomass"]^(1/2)) == F) ))) df.comp.r.avg$se.log.endo <- df.comp.r.avg$u.log.endo / sqrt(df.comp.r.avg$n.log.endo) df.comp.r.avg$se.sqrt.mass <- df.comp.r.avg$u.sqrt.mass / sqrt(df.comp.r.avg$n.sqrt.mass) df.comp.r.avg$c2 <- as.character(df.comp.r.avg$comp) df.comp.r.avg$c2[df.comp.r.avg$c2 == "NO"] <- "a.no" df.comp.r.avg$c2 <- factor(df.comp.r.avg$c2) df.once.avg <- do.call(rbind, lapply(unique(df.once$dot.h), function(i) data.frame( dot.h = i, clip = df.once[df.once$dot.h == i, "clip"][1], habitat = df.once[df.once$dot.h == i, "habitat"][1], u.log.endo = mean(log(df.once[df.once$dot.h == i, "endo"]), na.rm = T), sd.log.endo = sd(log(df.once[df.once$dot.h == i, "endo"]), na.rm = T), n.log.endo = sum(is.na(log(df.once[df.once$dot.h == i, "endo"])) == F), u.sqrt.mass = mean(df.once[df.once$dot.h == i, "biomass"]^(1/2), na.rm = T), sd.sqrt.mass = sd(df.once[df.once$dot.h == i, "biomass"]^(1/2), na.rm = T), n.sqrt.mass = sum(is.na(df.once[df.once$dot.h == i, "biomass"]^(1/2)) == F) ))) df.once.avg$se.log.endo <- df.once.avg$u.log.endo / sqrt(df.once.avg$n.log.endo) df.once.avg$se.sqrt.mass <- df.once.avg$u.sqrt.mass / sqrt(df.once.avg$n.sqrt.mass) df.once.avg$c2 <- as.character(df.once.avg$clip) df.once.avg$c2[df.once.avg$c2 == "NO CLIP"] <- "a.no" df.once.avg$c2 <- factor(df.once.avg$c2) df.mult.avg <- do.call(rbind, lapply(unique(df.mult$dot.h), function(i) data.frame( dot.h = i, clip = df.mult[df.mult$dot.h == i, "clip"][1], habitat = df.mult[df.mult$dot.h == i, "habitat"][1], u.log.endo = mean(log(df.mult[df.mult$dot.h == i, "endo"]), na.rm = T), sd.log.endo = sd(log(df.mult[df.mult$dot.h == i, "endo"]), na.rm = T), n.log.endo = sum(is.na(log(df.mult[df.mult$dot.h == i, "endo"])) == F), u.sqrt.mass = mean(df.mult[df.mult$dot.h == i, "biomass"]^(1/2), na.rm = T), sd.sqrt.mass = sd(df.mult[df.mult$dot.h == i, "biomass"]^(1/2), na.rm = T), n.sqrt.mass = sum(is.na(df.mult[df.mult$dot.h == i, "biomass"]^(1/2)) == F) ))) df.mult.avg$se.log.endo <- df.mult.avg$u.log.endo / sqrt(df.mult.avg$n.log.endo) df.mult.avg$se.sqrt.mass <- df.mult.avg$u.sqrt.mass / sqrt(df.mult.avg$n.sqrt.mass) df.mult.avg$c2 <- as.character(df.mult.avg$clip) df.mult.avg$c2[df.mult.avg$c2 == "NO CLIP"] <- "a.no" df.mult.avg$c2 <- factor(df.mult.avg$c2) t.legend <- theme( axis.text = element_text(size = 14, color = "black"), axis.text.y = element_text(size = 22), axis.title.x = element_text(size = 26), axis.title.y = element_text(size = 16), axis.line.x = element_line(color = "black"), axis.line.y = element_line(color = "black"), axis.ticks.x = element_line(color = "black"), axis.ticks.y = element_line(color = "black"), legend.position = c(0.15, 0.85), legend.title = element_blank(), legend.key = element_rect(fill = "white"), legend.text = element_text(size = 14), panel.grid = element_blank(), panel.background = element_rect(fill = "white") ) t.nolegend <- theme( axis.text = element_text(size = 14, color = "black"), axis.text.y=element_text(size = 22), axis.title.x = element_text(size = 26), axis.title.y = element_text(size = 16), axis.line.x = element_line(color = "black"), axis.line.y = element_line(color = "black"), axis.ticks.x = element_line(color = "black"), axis.ticks.y = element_line(color = "black"), legend.position = "none", panel.grid = element_blank(), panel.background = element_rect(fill = "white") ) p.e.herb <- ggplot(data = df.herb.avg, aes(y = u.log.endo, x = h2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = u.log.endo - se.log.endo, ymax = u.log.endo + se.log.endo), width = 0.25, position = position_dodge(1) ) + scale_y_continuous(position = 'right', breaks = log(1:50), labels = c(1, rep("", 8), 10, rep("", 9), 20, rep("", 9), 30, rep("", 9), 40, rep("", 9), 50), limits = log(c(1, 50)), expand = c(0, 0) ) + coord_flip()+ scale_x_discrete(labels = c("","","","","")) + #scale_x_discrete(labels = c("Control", "Beacon", "Glyph.", "Poast", "Pursuit")) + ylab("Endoreduplication") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.b.herb <- ggplot(data = df.herb.avg, aes(y = u.sqrt.mass^2, x = h2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = (u.sqrt.mass - se.sqrt.mass)^2, ymax = (u.sqrt.mass + se.sqrt.mass)^2), width = 0.25, position = position_dodge(1) ) + scale_y_reverse( lim= c(2.5,0), position = 'right') + coord_flip() + scale_x_discrete(position = 'top', labels = c("Control", "Beacon", "Glyph.", "Poast", "Pursuit")) + ylab("Biomass (g)") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.legend p.e.comp.r <- ggplot(data = df.comp.r.avg, aes(y = u.log.endo, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = u.log.endo - se.log.endo, ymax = u.log.endo + se.log.endo), width = 0.25, position = position_dodge(1) ) + scale_y_continuous(position = 'right', breaks = log(1:50), labels = c(1, rep("", 8), 10, rep("", 9), 20, rep("", 9), 30, rep("", 9), 40, rep("", 9), 50), limits = log(c(1, 50)), expand = c(0, 0) ) + coord_flip() + scale_x_discrete(labels = c("","","","","")) + ylab("") + xlab("") + #scale_x_discrete(labels = c("Control", "Corn", "J. Grass")) + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.b.comp.r <- ggplot(data = df.comp.r.avg, aes(y = u.sqrt.mass^2, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = (u.sqrt.mass - se.sqrt.mass)^2, ymax = (u.sqrt.mass + se.sqrt.mass)^2), width = 0.25, position = position_dodge(1) ) + scale_y_reverse( lim= c(2.5,0), position = 'right') + # breaks = seq(0, 2.5, by = 0.25), #limits = c(0, 2.5), #expand = c(0, 0) #) + coord_flip() + scale_x_discrete(position = 'top', labels = c("Control", "Corn", "J. Grass")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.e.comp.s <- ggplot(data = df.comp.s.avg, aes(y = u.log.endo, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = u.log.endo - se.log.endo, ymax = u.log.endo + se.log.endo), width = 0.25, position = position_dodge(1) ) + scale_y_continuous( position = 'right', breaks = log(1:50), labels = c(1, rep("", 8), 10, rep("", 9), 20, rep("", 9), 30, rep("", 9), 40, rep("", 9), 50), limits = log(c(1, 50)), expand = c(0, 0) ) + coord_flip() + scale_x_discrete(labels = c("","","")) + #scale_x_discrete(labels = c("Control", "Corn", "J. Grass")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.b.comp.s <- ggplot(data = df.comp.s.avg, aes(y = u.sqrt.mass^2, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = (u.sqrt.mass - se.sqrt.mass)^2, ymax = (u.sqrt.mass + se.sqrt.mass)^2), width = 0.25, position = position_dodge(1) ) + scale_y_reverse( lim= c(2.5,0), position = 'right') + # breaks = seq(0, 2.5, by = 0.25), #limits = c(0, 2.5), #expand = c(0, 0) #) + coord_flip() + scale_x_discrete(position = 'top', labels = c("Control", "Corn", "J. Grass")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.e.once <- ggplot(data = df.once.avg, aes(y = u.log.endo, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = u.log.endo - se.log.endo, ymax = u.log.endo + se.log.endo), width = 0.25, position = position_dodge(1) ) + scale_y_continuous( position = 'right', breaks = log(1:50), labels = c(1, rep("", 8), 10, rep("", 9), 20, rep("", 9), 30, rep("", 9), 40, rep("", 9), 50), limits = log(c(1, 50)), expand = c(0, 0) ) + coord_flip() + scale_x_discrete(labels = c ("","")) + #scale_x_discrete(labels = c("Control", "Clip Once")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.b.once <- ggplot(data = df.once.avg, aes(y = u.sqrt.mass^2, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = (u.sqrt.mass - se.sqrt.mass)^2, ymax = (u.sqrt.mass + se.sqrt.mass)^2), width = 0.25, position = position_dodge(1) ) + scale_y_reverse(position = 'right', lim = c(2.5,0)) + # breaks = seq(0, 2.5, by = 0.25), #limits = c(0, 2.5), #expand = c(0, 0) #) + coord_flip() + scale_x_discrete(position = 'top',labels = c("Control", "Clip Once")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.e.mult <- ggplot(data = df.mult.avg, aes(y = u.log.endo, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = u.log.endo - se.log.endo, ymax = u.log.endo + se.log.endo), width = 0.25, position = position_dodge(1) ) + scale_y_continuous(position = 'right', breaks = log(1:50), labels = c(1, rep("", 8), 10, rep("", 9), 20, rep("", 9), 30, rep("", 9), 40, rep("", 9), 50), limits = log(c(1, 50)), expand = c(0, 0) ) + coord_flip() + scale_x_discrete(labels = c("","")) + #scale_x_discrete(labels = c("Control", "Clip Mult.")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend p.b.mult <- ggplot(data = df.mult.avg, aes(y = u.sqrt.mass^2, x = c2, fill = habitat)) + geom_bar(stat = "identity", color = "black", position = position_dodge(width = 0.9)) + geom_errorbar( aes(ymin = (u.sqrt.mass - se.sqrt.mass)^2, ymax = (u.sqrt.mass + se.sqrt.mass)^2), width = 0.25, position = position_dodge(1) ) + scale_y_reverse(position = 'right', lim = c (2.5,0)) + # breaks = seq(0, 2.5, by = 0.25), #limits = c(0, 2.5), #expand = c(0, 0) #) + coord_flip() + scale_x_discrete(position = 'top',labels = c("Control", "Clip Mult.")) + ylab("") + xlab("") + scale_fill_manual(values = c("white", "grey")) + t.nolegend png("AlyssaEndoFigs.png", width = 17, height = 4.5, units = "in", res = 320, pointsize = 15) f.multiplot(list(p.e.herb, p.e.comp.r, p.e.once, p.e.mult), 4) dev.off() png("AlyssaMassFigs.png", width = 17, height = 4.5, units = "in", res = 320, pointsize = 15) f.multiplot(list(p.b.herb, p.b.comp.r, p.b.once, p.b.mult), 4) dev.off() png("AlyssaDCHFigs.png", width = 11, height = 22, units = "in", res = 320, pointsize = 15) grid.arrange(p.b.herb,p.e.herb,p.b.comp.r,p.e.comp.r,p.b.comp.s,p.e.comp.s,p.b.once,p.e.once,p.b.mult,p.e.mult, ncol = 2) dev.off() ##SessionInfo #R version 3.4.2 (2017-09-28) #Platform: x86_64-apple-darwin15.6.0 (64-bit) #Running under: macOS 10.14.2 #Matrix products: default #BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib #LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib #locale: # [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 #attached base packages: # [1] grid stats4 parallel stats graphics grDevices utils datasets methods base #other attached packages: # [1] emmeans_1.3.1 lmerTest_3.0-1 multcomp_1.4-8 TH.data_1.0-9 #[5] MASS_7.3-49 survival_2.41-3 mvtnorm_1.0-8 gridExtra_2.3 #[9] lme4_1.1-17 Matrix_1.2-13 cummeRbund_2.20.0 Gviz_1.22.3 #[13] rtracklayer_1.38.3 GenomicRanges_1.30.3 GenomeInfoDb_1.14.0 IRanges_2.12.0 #[17] S4Vectors_0.16.0 fastcluster_1.1.24 reshape2_1.4.3 ggplot2_2.2.1 #[21] RSQLite_2.1.0 BiocGenerics_0.24.0