tax2dist {rdiversity} | R Documentation |
Generate taxonomic distance matrix
Description
Calculates taxonomic distances between species.
Usage
tax2dist(lookup, tax_distance, precompute_dist = TRUE)
Arguments
lookup |
|
tax_distance |
|
precompute_dist |
object of class |
Value
tax2dist()
returns an object of class distance
containing a matrix
of pairwise taxonomic distances
References
Shimatani, K. 2001. On the measurement of species diversity incorporating species differences. Oikos 93:135–147.
Examples
# Create Lookup table
Species <- c("tenuifolium", "asterolepis", "simplex var.grandiflora", "simplex var.ochnacea")
Genus <- c("Protium", "Quararibea", "Swartzia", "Swartzia")
Family <- c("Burseraceae", "Bombacaceae", "Fabaceae", "Fabaceae")
Subclass <- c("Sapindales", "Malvales", "Fabales", "Fabales")
lookup <- cbind.data.frame(Species, Genus, Family, Subclass)
# Assign values for each level (Shimatani's taxonomic distance)
tax_distance <- c(Species = 0, Genus = 1, Family = 2, Subclass = 3, Other = 4)
# Generate pairwise distances
distance <- tax2dist(lookup, tax_distance)
similarity <- dist2sim(distance, "linear")