require(vegan)
################################################
# Tree data from 16 0.1-ha plots from the Highlands of Chiapas, southern Mexico
data(HCP)
data(HCP.coords)
geodist.HCP <- dist(HCP.coords)/1000 # Geographical distances in kms
# Define a new index that includes the terms used in the HCP dataset to define undetermined taxa at genus and family levels
index.new <- c(paste("Genus", as.character(c(1:20)), sep=""), paste("Family", as.character(c(1:20)), sep=""))
beta.HCP <- betaper(HCP, geodist = geodist.HCP, index = index.new)
beta.HCP # This results in a relatively low uncertainty range of the estimated correlation
beta.HCP$taxunc # Number of identified and unidentified species at different taxonomic levels
################################################
# Tree data from nine lowland sites in Western Amazonia
data(Amazonia)
data(soils)
# Define a new index that includes the terms used in the Amazonia dataset to define undetermined taxa at different taxonomic levels
index.Amazon <- c(paste("sp.", rep(1:20), sep=""), "Indet.", "indet.")
beta.Amazonia <- betaper(Amazonia, geodist = dist(log(soils)), index = index.Amazon, nsim = 50) # This can take a few minutes
beta.Amazonia # The uncertainty range of the estimated correlation is much larger than in the previous example
beta.Amazonia$taxunc # Number of identified and unidentified species at different taxonomic levelsRun the code above in your browser using DataLab