| traits2dist | R Documentation |
Build a pairwise functional distance matrix from a table of taxon traits,
suitable as the dist argument of hilldiv() and friends.
traits2dist(traits, method = c("gower", "euclidean", "manhattan"))
traits |
A table with taxa (OTUs/ASVs/MAGs) in rows and traits in columns. Traits may be continuous, binary or proportional. |
method |
Distance metric passed to |
A numeric distance matrix.
traits <- data.frame(body = c(1, 0.2, 0.9), diet = c(0L, 1L, 1L),
row.names = c("t1", "t2", "t3"))
traits2dist(traits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.