spat.beta {divraster} | R Documentation |
Spatial beta diversity for raster
Description
Calculates spatial beta diversity for
taxonomic (TD), functional (FD), and phylogenetic (PD)
dimensions. Adapted from beta
.
Usage
spat.beta(
x,
tree,
filename = "",
global = FALSE,
fm = NULL,
d = mean(terra::res(terra::rast(x))) * 2,
type = "circle",
na.policy = "omit",
...
)
Arguments
x |
A SpatRaster with presence-absence data (0 or 1) for a set of species. |
tree |
It can be a 'data.frame' with species traits or a 'phylo' with a rooted phylogenetic tree. Species names in 'tree' and 'x' must match! |
filename |
Character. Save results if a name is provided. |
global |
Logical. Mean of pairwise comparisons between focal cell and its neighbors (default) or mean of all pairwise comparisons. |
fm |
Numeric. Focal matrix ("moving window"). |
d |
Window radius to compute beta diversity. |
type |
Character. Window format. Default = "circle". |
na.policy |
Character. Default = "omit". See ?terra::focal3D for details. |
... |
Additional arguments to be passed passed down from a calling function. |
Details
The TD beta diversity partitioning framework we used was developed by Podani and Schmera (2011) and Carvalho et al. (2012) and expanded to PD and FD by Cardoso et al. (2014).
Value
A SpatRaster with beta results (total, replacement, richness difference, and ratio).
References
Cardoso, P. et al. 2014. Partitioning taxon, phylogenetic and functional beta diversity into replacement and richness difference components. - Journal of Biogeography 41: 749–761.
Carvalho, J. C. et al. 2012. Determining the relative roles of species replacement and species richness differences in generating beta-diversity patterns. - Global Ecology and Biogeography 21: 760–771.
Podani, J. and Schmera, D. 2011. A new conceptual and methodological framework for exploring and explaining pattern in presence - absence data. - Oikos 120: 1625–1638.
Hidasi-Neto, J. et al. 2019. Climate change will drive mammal species loss and biotic homogenization in the Cerrado Biodiversity Hotspot. - Perspectives in Ecology and Conservation 17: 57–63.
Examples
library(terra)
bin1 <- terra::rast(system.file("extdata", "ref.tif",
package = "divraster"))
traits <- read.csv(system.file("extdata", "traits.csv",
package = "divraster"), row.names = 1)
rownames(traits) <- names(bin1)
tree <- ape::read.tree(system.file("extdata", "tree.tre",
package = "divraster"))
spat.beta(bin1)
spat.beta(bin1, traits)
spat.beta(bin1, tree)