Carnegie Science InsituteMar 21 2019 UTC

Figure 2 - Phenotype Plots

Fecundity

DailyFecundityData.csv
mydata<-read.csv(DailyFecundityData.csv, header=TRUE, sep=",")
attach(mydata)
sterr <- function(x) {
  sd(x)/sqrt(length(x))
}

stderr<-aggregate(fecundity..eggs.female., by=list(treat), FUN="sterr")
means<-aggregate(fecundity..eggs.female., by=list(treat), FUN="mean")

spacing<-c(1.05, 0.95, 0.87, 0.93, 1.05, 1.9, 2, 1.76, 1.67, 2, 2.1, 1.85, 1.88, 2.1, 2.16, 2.57, 3.07, 2.65, 2.74, 3.19, 2.93, 2.84, 3.5, 3.22, 3.34, 3.9, 4.13, 3.96, 4.03, 4.23, 5, 0)
points<-c(1:32)
points<-as.character(points)
par(mar=c(5,5,2,2))
plot(spacing, means$x, pch=21, cex=3.5, cex.axis=1, cex.lab=1, ylim=c(1,5), ylab="Fecundity (progeny/day/female)", xlab="Number of species")
arrows(spacing,means$x-stderr$x,spacing,means$x+stderr$x, code=3, length=0.02, angle = 90)
text(spacing, means$x, labels=points)

Survival

SurvivalData.csv
mydata<-read.csv(SurvivalData.csv, header=TRUE, sep=",")
attach(mydata)

sterr <- function(x) {
			sd(x)/sqrt(length(x))
	}

stderr<-aggregate(time.to.death..days., by=list(treatment), FUN="sterr")
means<-aggregate(time.to.death..days., by=list(treatment), FUN="mean")
spacing<-c(0.975, 1.1, 0.9, 1.1, 0.85, 2.2, 2.3, 1.9, 2.2, 2.05, 1.9, 2.1, 1.725, 1.88, 2.0, 3.3, 3.1, 3.3, 3.12, 2.725, 3, 3.025, 3.2, 2.85, 2.925, 3.9,4, 4.1, 4.15, 4, 5, 0)
points<-c(1:32)
points<-as.character(points)
par(mar=c(5,5,2,2))
plot(spacing, means$x, pch=21, cex=3.5, cex.axis=1, cex.lab=1, ylim=c(37,57), ylab="Time to death (days)", xlab="Number of species")
arrows(spacing,means$x-stderr$x,spacing,means$x+stderr$x, code=3, length=0.02, angle = 90)
text(spacing, means$x, labels=points)

Development

DevelopmentData.csv
mydata <- read.csv(DevelopmentData.csv, header = TRUE, sep=",")
attach(mydata)

sterr <- function(x) {
			sd(x)/sqrt(length(x))
	}

means<-aggregate(development..days., by=list(treatment), FUN="mean")
stderr<-aggregate(development..days., by=list(treatment), FUN="sterr")

spacing<-c(1.1, 0.915, 0.825, 1.015, 1.15, 1.78, 2.05, 1.8, 1.78, 1.95, 1.98, 2, 2.25, 2.12, 2.25, 3.14, 3.3, 3.4, 3.1, 2.83, 2.88, 3.23, 2.98, 2.7, 3, 3.85, 3.9, 4, 4.1, 4.15, 5, 0)
points<-c(1:32)
points<-as.character(points)
par(mar=c(5,5,2,2))
plot(spacing, means$x, pch=21, cex=3.5, cex.axis=1, cex.lab=1, ylim=c(9,12), ylab="Development time (days)", xlab="Number of species")
text(spacing, means$x, labels=points)
arrows(spacing,means$x-stderr$x,spacing,means$x+stderr$x, code=3, length=0.02, angle = 90)

Bacterial Load

FlygutCFUsData.csv
mydata <- read.csv(FlygutCFUsData.csv, header = TRUE, sep=",")
attach(mydata)

sterr <- function(x) {
		sd(x)/sqrt(length(x))
	}

means<-aggregate(Total.CFU, by=list(treatment), FUN="mean")
stderr<-aggregate(Total.CFU, by=list(treatment), FUN="sterr")

spacing<-c(1.1, 0.9, 0.8, 1.0, 1.15, 1.78, 1.85, 2.0, 1.78, 2.1, 2.2, 2, 2.25, 2.12, 2.25, 2.95, 3.3, 3.4, 3.1, 2.83, 2.88, 3.23, 2.98, 2.7, 3, 3.85, 3.975, 4, 4.1, 4.15, 5, 0)
points<-c(1:32)
points<-as.character(points)
par(mar=c(5,5,2,2))
plot(spacing, means$x, pch=21, cex=3.5, cex.axis=1, cex.lab=1, ylim=c(0,9e5), ylab="Bactieral Load (CFUs)", xlab="Number of species")
text(spacing, means$x, labels=points)
arrows(spacing,means$x-stderr$x,spacing,means$x+stderr$x, code=3, length=0.02, angle = 90)