data(africa)
tr <- data.frame(species = africa$trait$species,
height = log10(africa$trait$h_max),
habit = africa$trait$habit)
status <- ifelse(africa$IUCN$IUCN %in% c("CR", "EN", "VU"),
"threatened", "not_threatened")
names(status) <- africa$IUCN$Species
g <- tpd_groups(status)
tpd_alpha(g, tr) # trait spectrum of each group
tpd_beta(g, tr) # how different the spectra are
Run the code above in your browser using DataLab