Uses a 'gridded' shapefile and its corresponding community data matrix to calculate beta diversity for each focal grid cell in relation to its neighbor cells (for example, 8 nearest neighbors).
betagrid(
gridshp,
comp,
xfeature,
yfeature,
radius,
phylotree,
phylobeta = F,
index = "sorensen"
)
A data frame with values of mean turnover, mean nestedness, and mean beta diversity for each grid cell.
Gridded Shapefile ("SpatialPolygonsDataFrame").
community data matrix (species occurrence on each grid cell).
number of the feature within the gridded shapefile corresponding to the longitude.
number of the feature within the grid shapefile corresponding to the latitude.
the radius (in degrees) that define the maximum distance to select neighbor cells (for example, use the resolution of the gridded shapefile).
optional phylogenetic tree ("phylo" class). It can also be a "phylo" class functional dendrogram.
Optional boolean whether or not to calculate or not phylogenetic beta diversity (see "phylo.beta.pair" function in "betapart" package) instead of the usual beta diversity (see "beta.pair" function in "betapart" package). Default is F.
to calculate "sorensen" or "jaccard". Default is "sorensen".
# https://rfunctions.blogspot.com/2015/08/calculating-beta-diversity-on-grid.html
Run the code above in your browser using DataLab