Learn R Programming

phyloregion (version 2.1.0)

tpd_extinction: Simulated extinctions and the loss of functional diversity

Description

tpd_extinction removes species at random according to their extinction probabilities (for example from their IUCN category), many times, and compares the trait spectrum before and after. As a null model, the same number of species is removed completely at random.

Usage

tpd_extinction(trait, prob, nsim = 100, ...)

Value

A list with sims, a data frame with one row per simulation (scenario, species lost, FRic, FEve and FRed relative to the current spectrum, and overlap with the current spectrum), and summary, the mean and 95% range of each quantity for the extinction scenario and for random loss of the same number of species.

Arguments

trait

A data frame with the first column labeled “species” and the remaining columns containing continuous and/or categorical traits.

prob

A numeric vector of extinction probabilities (0 to 1), one per species, named by species.

nsim

Number of simulations for each scenario.

...

Further arguments passed to the internal TPD builder, see tpd_alpha.

References

Carmona, C.P., Tamme, R., Partel, M. et al. (2021) Erosion of global functional diversity across the tree of life. Science Advances 7: eabf2675.

See Also

tpd_groups, tpd_beta

Examples

Run this code
data(africa)
tr <- data.frame(species = africa$trait$species,
                 height = log10(africa$trait$h_max),
                 habit = africa$trait$habit)
# hypothetical extinction probabilities for each IUCN category
p <- c(LC = 0.001, NT = 0.01, VU = 0.1, EN = 0.5, CR = 0.9)
prob <- setNames(p[africa$IUCN$IUCN], africa$IUCN$Species)
set.seed(1)
ex <- tpd_extinction(tr, prob, nsim = 20)
ex$summary

Run the code above in your browser using DataLab