################################################################### # # Code to produce Figure 4 in: Burgess, Sander, Bueno (xxxx) # How relatedness between mates influences reproductive success: # an experimental analysis of self-fertilization and biparental # inbreeding in a marine bryozoan. Ecology and Evolution #: ##-## # #################################################################### # setwd("") library(lme4) # version 1.1-21 dat <- read.csv("Data for figure 4.csv",header=T) # dat <- dat[order(dat$Population,dat$Triadic),] # summary(dat) # Figure 4 quartz(width=3,height=5) par(mfrow=c(3,1),mar=c(1,1,1,1),oma=c(5.2,4.5,1,1)) cexs <- 2 cex.ax <- 1.5 bks <- seq(0,0.3,0.01) xax <- seq(0,0.3,0.05) with(dat[dat$Population=="Dog Island",],hist(Triadic,main="",col="grey",breaks=bks,xaxt="n",las=1,cex.axis=cex.ax)) axis(side=1,at=xax,labels=xax,cex.axis=cex.ax) mtext("A) Site 1 (Dog Island)\nn=30",side=3,line=-3,adj=0,at=0.03,padj=0.1) with(dat[dat$Population=="Marine Lab",],hist(Triadic,main="",col="grey",breaks=bks,xaxt="n",las=1,cex.axis=cex.ax)) axis(side=1,at=xax,labels=xax,cex.axis=cex.ax) mtext("B) Site 2 (Marine Lab)\nn=10",side=3,line=-3,adj=0,at=0.03,padj=0.1) with(dat[dat$Population=="OMT",],hist(Triadic,main="",col="grey",breaks=bks,xaxt="n",las=1,cex.axis=cex.ax)) axis(side=1,at=xax,labels=xax,cex.axis=cex.ax) mtext("C) Site 3 (One More Time)\nn=35",side=3,line=-3,adj=0,at=0.03,padj=0.1) mtext(expression(paste("Individual inbreeding coefficient, ",italic(f))),side=1,line=2,outer=T,adj=.7) mtext("(Triadic IBD coefficient)",side=1,line=3.3,outer=T,adj=.5) mtext("Number of individuals\n(Grandparent generation)", side=2,line=1.5,outer=T) mean(dat[dat$Population=="Dog Island",3]);quantile(dat[dat$Population=="Dog Island",3],c(0.025,0.975)) mean(dat[dat$Population=="Marine Lab",3]);quantile(dat[dat$Population=="Marine Lab",3],c(0.025,0.975)) mean(dat[dat$Population=="OMT",3]);quantile(dat[dat$Population=="OMT",3],c(0.025,0.975))