Skip to contents

This function calculates evolutionary distinctiveness according to the fair-proportion index. The values represents the mean ED for species presents in each raster cell.

Usage

rast.ed(x, tree, edge.path, branch.length, n.descen, filename = "", ...)

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.

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

filename

character. Output filename

...

additional arguments passed for terra::app

Value

SpatRaster

References

Isaac, N. J., Turvey, S. T., Collen, B., Waterman, C. and Baillie, J. E. (2007). Mammals on the EDGE: conservation priorities based on threat and phylogeny. PLoS ONE 2, e296.

Author

Neander Marcel Heming and Gabriela Alves-Ferreira

Examples

# \donttest{
library(terra)
library(phyloraster)
x <- rast(system.file("extdata", "rast.presab.tif",
package="phyloraster"))
# phylogenetic tree
tree <- ape::read.tree(system.file("extdata", "tree.nex",
package="phyloraster"))
data <- phylo.pres(x[[1:3]], tree)
#> Warning: Some species in the phylogeny 'tree' are missing from the
#>                   SpatRaster 'x' and were dropped: Litoria_dorsalis, Litoria_rubella, Litoria_nigrofrenata, Litoria_nasuta, Litoria_tornieri, Litoria_inermis, Litoria_pallida, Litoria_latopalmata, Litoria_bicolor, Litoria_fallax, Litoria_genimaculata, Litoria_andiirrmalin, Litoria_wilcoxii, Litoria_jungguy, Litoria_caerulea, Litoria_gracilenta, Litoria_chloris, Litoria_xanthomera, Cyclorana_brevipes, Cyclorana_novaehollandiae, Cyclorana_manya, Cyclorana_cultripes, Litoria_alboguttata, Cyclorana_longipes, Nyctimystes_dayi, Litoria_nannotis, Litoria_lorica, Litoria_rheocola, Litoria_nyakalensis, Litoria_infrafrenata
ed <- rast.ed(data$x, edge.path = data$edge.path,
              branch.length = data$branch.length,
              n.descen = data$n.descen)
plot(ed)

# }