setwd("~/Dropbox/Indo-Pacific Tropical Cenozoic Ostracoda study 2014/Journal of Biogeography/Revision/Re-revision/Re-Re-Revision/Dryad Final Data and Code/for other plots") ## Set the working directory as you like require(gdata) ## LSDG plot quartz(width=4,height=9) par(ps=18) par(mfrow=c(4,1)) par(mar=c(3,5,0,4)) par(oma=c(4,0,4,0)) x<- read.xls(xls="Modern_dataset.xlsx", sheet=1) head(x) Lat <- x[,1] Dep <- x[,3] Div <- x[,5] plot(Div ~ Lat, xlab="Latitude", ylab="Species richness", xlim = c(-10, 45), ylim = c(0, 100), pch=21, bg='lightgrey', col='black', cex=1.5) #plot(Div ~ Dep, xlab="Region", ylab="Species richness", ylim = c(0, 100)) #summary (lm(Div ~ Dep)) x1<- read.xls(xls="PlioPleist_dataset.xlsx", sheet=2) #Pleistocene head(x1) x2<- read.xls(xls="PlioPleist_dataset.xlsx", sheet=3) #Pliocene head(x2) Lat1 <- x1[,2] Div1 <- x1[,5] Lat2 <- x2[,2] Div2 <- x2[,5] plot(Div1 ~ Lat1, xlab="Latitude", ylab="Species richness", xlim = c(-10, 45), ylim = c(0, 100), pch=21, bg='tomato1', col='black', cex=1.5) points(Div2 ~ Lat2, pch=24, cex=1.5, bg='turquoise3', col='black') x1<- read.xls(xls="LateMio_dataset.xlsx", sheet=1) head(x1) Lat1 <- x1[,2] Div1 <- x1[,5] x2<- read.xls(xls="MidMio_dataset.xlsx", sheet=1) head(x2) Lat2 <- x2[,2] Div2 <- x2[,5] x3<- read.xls(xls="EarlyMio_dataset.xlsx", sheet=1) head(x3) Lat3 <- x3[,2] Div3 <- x3[,5] plot(Div1 ~ Lat1, xlab="Latitude", ylab="Species richness", xlim = c(-10, 45), ylim = c(0, 100), pch=21, bg='tomato1', col='black', cex=1.5) points(Div2 ~ Lat2, pch=24, cex=1.5, bg='turquoise3', col='black') points(Div3 ~ Lat3, pch=22, cex=1.5, bg='steelblue', col='black') x1<- read.xls(xls="Eo_Olig_dataset.xlsx", sheet=2) #Oligocene head(x1) Lat1 <- x1[,2] Div1 <- x1[,5] x2<- read.xls(xls="Eo_Olig_dataset.xlsx", sheet=3) #Eocene head(x2) Lat2 <- x2[,2] Div2 <- x2[,5] x3<- read.xls(xls="Eo_Olig_dataset.xlsx", sheet=4) #Either Oligocene or Eocene head(x3) Lat3 <- x3[,2] Div3 <- x3[,5] plot(Div1 ~ Lat1, xlab="Latitude", ylab="Species richness", xlim = c(-10, 45), ylim = c(0, 20), pch=21, bg='tomato1', col='black', cex=1.5) points(Div2 ~ Lat2, pch=24, cex=1.5, bg='turquoise3', col='black') points(Div3 ~ Lat3, pch=22, cex=1.5, bg='lightgrey', col='black') ## End of LSDG plot ## Age plot quartz(width=6,height=9) par(ps=18) par(mfrow=c(3,1)) par(mar=c(3,5,0,4)) par(oma=c(4,0,4,0)) x<- read.xls(xls="IAA_dataset.xlsx", sheet=1) head(x) Div <- x[,6] Per <- x[,1] plot(Div ~ Per, xlab="Age", ylab="Species richness", cex = 1.5, ylim = c(0, 100), pch=21, bg='lightgrey', col='black') x<- read.xls(xls="SWJP_dataset.xlsx", sheet=1) head(x) Div <- x[,6] Per <- x[,1] plot(Div ~ Per, xlab="Age", ylab="Species richness", cex = 1.5, ylim = c(0, 100), xlim = c(0, 40), pch=21, bg='lightgrey', col='black') x<- read.xls(xls="NEJP_dataset.xlsx", sheet=1) head(x) Div <- x[,6] Per <- x[,1] plot(Div ~ Per, xlab="Age", ylab="Species richness", cex = 1.5, ylim = c(0, 100), xlim = c(0, 40), pch=21, bg='lightgrey', col='black') ##End of Age plots ## Depth plot x<- read.xls(xls="Modern_dataset.xlsx", sheet=1) head(x) Dep <- x[,3] Div <- x[,5] plot(Div ~ Dep, xlab="Depth (m)", ylab="Species richness", ylim = c(0, 100), pch=21, bg='gray', col='black') summary (lm(Div ~ Dep)) ## Longitude plot x<- read.xls(xls="Modern_IAA_dataset.xlsx", sheet=1) head(x) Lon <- x[,2] Div <- x[,5] plot(Div ~ Lon, xlab="Longitude", ylab="Species richness", ylim = c(0, 100), pch=21, bg='gray', col='black') summary (lm(Div ~ Lon))