tax2dist | R Documentation |
Calculates taxonomic distances between species.
tax2dist(lookup, tax_distance, precompute_dist = TRUE)
lookup |
|
tax_distance |
|
precompute_dist |
object of class |
tax2dist()
returns an object of class distance
containing a matrix
of pairwise taxonomic distances
Shimatani, K. 2001. On the measurement of species diversity incorporating species differences. Oikos 93:135–147.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.