Calculate phylogenetic community metrics and their standardized effect sizes for raster data
Source:R/geo.phylo.R
geo.phylo.ses.Rd
Calculates the standardized effect size for phylogenetic community metrics. See Details for more information.
Arguments
- x
SpatRaster. A SpatRaster containing presence-absence data (0 or 1) for a set of species. The layers (species) will be sorted according to the tree order. See the phylo.pres function.
- tree
phylo. A dated tree.
- inv.R
SpatRaster. Inverse of range size. See
inv.range
- edge.path
matrix representing the paths through the tree from root to each tip. See
phylo.pres
- branch.length
numeric. A Named numeric vector of branch length for each species. See
phylo.pres
- n.descen
numeric. A Named numeric vector of number of descendants for each branch. See
phylo.pres
- spat_alg
A function with the algorithm implementing the desired randomization method. It must work with SpatRaster objects. See examples. Example of functions that work are:
bootspat_naive
,bootspat_str
,bootspat_ff
.- spat_alg_args
List of arguments passed to the randomization method chosen in 'spat_alg'. See
bootspat_naive
,bootspat_str
,bootspat_ff
- random
character. A character indicating the type of randomization. The currently available randomization methods are "tip", "site", "species" or "both" (site and species).
- aleats
positive integer. A positive integer indicating how many times the calculation should be repeated.
- cores
positive integer. If
cores > 1
, a 'parallel' package cluster with that many cores is created and used. You can also supply a cluster object. Ignored for functions that are implemented by terra in C++ (see under fun)- filename
character. Output filename
- ...
additional arguments passed for terra::app
Details
The spatial randomization (spat) keeps the richness exact and samples species presences proportionally to their observed frequency (i.e. number of occupied pixels). The randomization will not assign values to cells with nodata.
References
Williams, P.H., Humphries, C.J., Forey, P.L., Humphries, C.J., VaneWright, R.I. (1994). Biodiversity, taxonomic relatedness, and endemism in conservation. In: Systematics and Conservation Evaluation (eds Forey PL, Humphries C.J., Vane-Wright RI), p. 438. Oxford University Press, Oxford.
Crisp, M., Laffan, S., Linder, H., Monro, A. (2001). Endemism in the Australian flora. Journal of Biogeography, 28, 183–198.
Examples
# \donttest{
library(terra)
library(phyloraster)
require("SESraster")
#> Loading required package: SESraster
#> This is SESraster 0.7.0
#> If you use SESraster, please cite in your publications. See:
#> citation("SESraster")
x <- terra::rast(system.file("extdata", "rast.presab.tif",
package="phyloraster"))
tree <- ape::read.tree(system.file("extdata", "tree.nex",
package="phyloraster"))
tses <- geo.phylo.ses(x = x,
tree = tree,
# FUN_args = list(range.BL=area.branch$range.BL,
# inv.R=area.branch$inv.R,
# branch.length=data$branch.length,
# n.descen = data$n.descendants),
spat_alg = "bootspat_str",
spat_alg_args = list(rprob = NULL,
rich = NULL,
fr_prob = NULL),
aleats = 2)
terra::plot(tses)
# }