(zeta-diversity can’t handle abundance data)
read.and.pa <- function(data.path) {
raw <- read.table(data.path, header=T, sep=",")
rownames(raw) <- raw$sites
raw$sites <- NULL
decostand(raw, "pa")
}
adry13 <- read.and.pa("adry13.csv")
adry14 <- read.and.pa("adry14.csv")
awet13 <- read.and.pa("awet13.csv")
awet14 <- read.and.pa("awet14.csv")
Plot.zeta.decline(Zeta.decline.ex(adry13, orders = 1:10))
text(5, 5, "adry13", cex=3, font=2, col="red")
Plot.zeta.decline(Zeta.decline.ex(adry14, orders = 1:10))
text(5, 5, "adry14", cex=3, font=2, col="red")
Plot.zeta.decline(Zeta.decline.ex(awet13, orders = 1:10))
text(5, 5, "awet13", cex=3, font=2, col="blue")
Plot.zeta.decline(Zeta.decline.ex(awet14, orders = 1:10))
text(5, 5, "awet14", cex=3, font=2, col="blue")
points <- read.table("/home/indra/Documents/2013scarabs/publications/20160601.c3.sahara.tax/tables.and.figures/f1.map/dat.20140724.aridity.at.replicas.csv", header=T, dec=".")
replicate.coords <- points[, c("LONGITUD", "LATITUD")]
replicate.coords$point <- as.numeric(gsub("mor.|A|B", "", points$replicas))
library(plyr)
mor.sites <- ddply(replicate.coords, .(point), summarize,
"x" = mean(LONGITUD),
"y" = mean(LATITUD))
mor.coords <- mor.sites[,c("x","y")]
par(mfrow=c(3,3), mar=c(4,4,1,1))
plot(mor.coords, main="Geografic distribution of sampling sites", asp=1)
orders <- 2:9
invisible(lapply(orders, function(order){
Zeta.ddecay(mor.coords*100000, adry13, sam = 100, order = order, method.glm = "glm.fit2", confint.level = 0.95, trsf = "log", normalize = "Jaccard")
}))
zeta.ddecays.marion <- Zeta.ddecays(mor.coords*100000, adry13, sam = 100,
orders = orders, plot = TRUE, confint.level = 0.95)
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
## [1] 9