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