raster.dispersion | R Documentation |
Average dissimilarity between any two species or individuals randomly chosen in a community using rasters of species distributions (presence/absence or abundance).
raster.dispersion(
layers,
tree,
distance,
func = "originality",
abund = FALSE,
relative = FALSE
)
layers |
A SpatRaster object of species distributions from package terra. |
tree |
A phylo or hclust object or alternatively a species x traits matrix or data.frame to build a functional tree. |
distance |
A dist object representing the phylogenetic or functional distance between species. |
func |
Calculate dispersion using originality (default), uniqueness or contribution. |
abund |
A boolean (T/F) indicating whether dispersion should be calculated using individuals (T) or species (F). |
relative |
A boolean (T/F) indicating whether dispersion should be relative to the maximum distance between any two species in the tree or distance matrix. |
If abundance data is used and a tree is given, dispersion is the quadratic entropy of Rao (1982). If abundance data is not used but a tree is given, dispersion is the phylogenetic dispersion measure of Webb et al. (2002). Note that cells with less than two species cannot have dispersion values.
A SpatRaster object representing dispersion in space.
Rao, C.R. (1982) Diversity and dissimilarity coefficients: a unified approach. Theoretical Population Biology, 21: 24-43.
Webb, C.O., Ackerly, D.D., McPeek, M.A. & Donoghue, M.J. (2002) Phylogenies and community ecology. Annual Review of Ecology and Systematics, 33: 475-505.
sp1 <- terra::rast(matrix(c(NA,1,1,1,1,0,0,0,0), nrow = 3, ncol = 3, byrow = TRUE))
sp2 <- terra::rast(matrix(c(0,0,0,0,1,1,1,1,1), nrow = 3, ncol = 3, byrow = TRUE))
sp3 <- terra::rast(matrix(c(0,0,0,1,1,1,0,0,0), nrow = 3, ncol = 3, byrow = TRUE))
spp <- c(sp1, sp2, sp3)
tree <- hclust(dist(c(1:3), method="euclidean"), method="average")
tree$labels = c("Sp1", "Sp2", "Sp3")
names(spp) = tree$labels
raster.dispersion(spp, tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.