tree.quality | R Documentation |
Assess the quality of a functional tree.
tree.quality(distance, tree)
distance |
A dist object representing the initial distances between species. |
tree |
A phylo or hclust object. |
The algorithm calculates the inverse of mean squared deviation between initial and cophenetic distances (Maire et al. 2015) after standardization of all values between 0 and 1 for simplicity of interpretation. A value of 1 corresponds to maximum quality of the functional representation. A value of 0 corresponds to the expected value for a star tree, where all pairwise distances are 1.
A single value of quality.
Maire et al. (2015) How many dimensions are needed to accurately assess functional diversity? A pragmatic approach for assessing the quality of functional spaces. Global Ecology and Biogeography, 24: 728:740.
trait = data.frame(body = c(1,2,3,4,4), beak = c(1,1,1,1,2))
distance = gower(trait)
tree = tree.build(trait)
tree.quality(distance, tree)
tree = tree.build(trait, func = "bionj")
tree.quality(distance, tree)
tree = tree.build(trait, func = "upgma")
tree.quality(distance, tree)
tree = tree.build(trait, func = "mst")
tree.quality(distance, tree)
tree = tree.build(trait, func = "best")
distance1 = distance
distance1[] = 1
tree = hclust(distance1)
tree.quality(distance, tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.