tree.quality: Quality of tree.

View source: R/BAT.R

tree.qualityR Documentation

Quality of tree.

Description

Assess the quality of a functional tree.

Usage

tree.quality(distance, tree)

Arguments

distance

A dist object representing the initial distances between species.

tree

A phylo or hclust object.

Details

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.

Value

A single value of quality.

References

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.

Examples

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)

BAT documentation built on May 29, 2024, 7:35 a.m.

Related to tree.quality in BAT...