if (FALSE) {
#Time consuming
require(ade4)
data(duneFVG)
data(duneFVG.xy)
data(duneFVG.tr8)
tr8_N<-duneFVG.tr8$traits.tot[,c(1,3,4)]
tr8_D<-data.frame(duneFVG.tr8$traits.tot[,2])
tr8_Q<-duneFVG.tr8$traits.tot[,5:15]
tr8dist<-dist.ktab(ktab.list.df(list(tr8_N,tr8_D,tr8_Q)),type=c('N','D','Q'))
tr8dist<-cailliez(tr8dist)
dist_sp<-dist(duneFVG.xy$tot.xy,'euclidean')
## Rao index
## Take care that the following scripts may be time-consuming
rare<-ser_functional(duneFVG$total,tr8dist,dist_sp,method='rao',comparison=TRUE)
plot(rare [,1], ylab="Rao QE", xlab="Number of plots", type="l", ylim=range(rare, na.rm=TRUE))
lines(rare[,2], lty=2)
lines(rare[,3], lty=2)
lines(rare[,4 ], col=2)
lines(rare[,5], lty=2, col=2)
lines(rare[,6], lty=2, col=2)
legend("bottomright", legend=c("spatially-explicit rarefaction", "classic rarefaction"),
lty=1, col=1:2)
# dashed lines represent the confidence interval
## Chao index
rareC<-ser_functional(duneFVG$total,tr8dist,dist_sp,method='chao',tau=0.6,q=2,comparison
=TRUE)
plot(rareC [,1], ylab="Chao", xlab="Number of plots", type="l", ylim=range(rareC, na.rm
=TRUE))
lines(rareC[,2], lty=2)
lines(rareC[,3], lty=2)
lines(rareC[,4 ], col=2)
lines(rareC[,5], lty=2, col=2)
lines(rareC[,6], lty=2, col=2)
legend("bottomright", legend=c("spatially-explicit rarefaction", "classic rarefaction"),
lty=1, col=1:2)
# dashed lines represent the confidence interval
}
Run the code above in your browser using DataLab