rast.pe.ses | R Documentation |
Calculates the standardized effect size for phylogenetic endemism. See Details for more information.
rast.pe.ses(
x,
tree,
branch.length,
branch.length.alt,
inv.R,
full_tree_metr = TRUE,
spat_alg = "bootspat_str",
spat_alg_args = list(rprob = NULL, rich = NULL, fr_prob = NULL),
metric = c("pe", "pe.alt", "rpe", "all")[4],
aleats = 10,
cores = 1,
filename = "",
overwrite = TRUE,
...
)
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. |
branch.length |
numeric. A Named numeric vector of branch length for
each species. See |
branch.length.alt |
numeric. Branch length calculated by using an alternative phylogeny with non-zero branch lengths converted to a constant value (1) and rescaled so the sum of all branch lengths is 1. |
inv.R |
SpatRaster. Inverse of range size. See |
full_tree_metr |
logical. Whether edge.path, branch length and number of descendants should be calculated with the full (TRUE) or the prunned tree (FALSE). The default is TRUE. |
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: |
spat_alg_args |
List of arguments passed to the randomization method
chosen in 'spat_alg'. See |
metric |
character. Names of biodiversity metrics to calculate (pe, pe_alt, rpe, all). See details. |
aleats |
positive integer. A positive integer indicating how many times the calculation should be repeated. |
cores |
positive integer. If |
filename |
character. Output filename |
overwrite |
logical. If TRUE, filename is overwritten |
... |
additional arguments passed for terra::app |
The dependency ‘SESraster’ is used to calculate the null models. This package currently implements six algorithms to randomize binary species distribution with several levels of constraints: SIM1, SIM2, SIM3, SIM5, SIM6 and SIM9 (sensu Gotelli 2000). The methods implemented in ‘SESraster’ are based on how species (originally rows) and sites (originally columns) are treated (i.e. fixed, equiprobable, or proportional sums) (Gotelli 2000). By default, the ‘phyloraster’ uses the function bootspat_ str() from the ‘SESraster’ package to conduct the randomizations, but the user is free to choose any of the other methods mentioned above through the spat_alg argument in the *.ses() functions of the ‘phyloraster’ package. The bootspat_str() is equivalent to the SIM5 (proportional-fixed) method of Gotelli (2000), which partially relaxes the spatial structure of species distributions, but keeps the spatial structure of the observed richness pattern across cells. Biodiversity metrics available are:
pe: Phylogenetic endemism (Rosauer et al., 2009)
pe.alt: Alternate Phylogenetic endemism (Mishler et al., 2014)
rpe: Relative Phylogenetic endemism (Mishler et al., 2014)
all: Calculate all available metrics Alternate phylogenetic endemism (PE.alt, Mishler et al., 2014) is calculated using an alternate phylogeny with non-zero branch lengths converted to a constant value (here we use 1) and rescaled so the sum of all branch lengths is 1. Relative phylogenetic endemism (RPE, Mishler et al., 2014) is the ratio of phylogenetic endemism (PE, Rosauer et al., 2009) measured on the original tree versus PE measured on a alternate tree (PE.alt).
SpatRaster. The function returns the observed value of the metric, the mean of the simulations calculated over n times, the standard deviation of the simulations, the standardized effect size (SES) for the metric, and the p-values.
Gabriela Alves-Ferreira and Neander Heming
Gotelli, N. J. 2000. Null model analysis of species co-occurrence patterns. Ecology 81: 2606–2621.
Heming, N. M., Mota, F. M. M. and Alves-Ferreira, G. 2023. SESraster: raster randomization for null hypothesis testing. https://CRAN.R-project.org/package=SESraster.
Mishler, B. D., Knerr, N., González-Orozco, C. E., Thornhill, A. H., Laffan, S. W. and Miller, J. T. 2014. Phylogenetic measures of biodiversity and neo- and paleo-endemism in Australian Acacia. – Nat. Commun. 5: 4473.
Rosauer, D. A. N., Laffan, S. W., Crisp, M. D., Donnellan, S. C., & Cook, L. G. (2009). Phylogenetic endemism: a new approach for identifying geographical concentrations of evolutionary history. Molecular ecology, 18(19), 4061-4072.
phylo.pres
,
inv.range
,
geo.phylo.ses
,
rast.ed.ses
,
rast.pd.ses
,
rast.we.ses
,
rast.pe.ses
,
bootspat_str
,
bootspat_naive
,
bootspat_ff
,
SESraster
library(terra)
library(phyloraster)
library(SESraster)
x <- terra::rast(system.file("extdata", "rast.presab.tif",
package="phyloraster"))
tree <- ape::read.tree(system.file("extdata", "tree.nex",
package="phyloraster"))
data <- phylo.pres(x[[1:3]], tree)
t <- rast.pe.ses(x = data$x, data$tree, aleats = 99, metric = "all")
plot(t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.