tree.build | R Documentation |
Builds a functional tree from distance data.
tree.build(distance, func = "nj", fs = 0, root = NULL)
distance |
A dist object. |
func |
One of "upgma", "mst", "nj", "bionj" or "best". |
fs |
Only used for func = "nj" OR "bionj". Argument s of the agglomerative criterion: it is coerced as an integer and must at least equal to one. |
root |
A numeric or character specifying the functional outgroup to root the tree. |
The tree will be built using one of four algorithms: If func = "upgma" uses average linkage clustering (UPGMA, Cardoso et al. 2014). If func = "mst" uses minimum spanning trees, equivalent to single linkage clustering (Gower & Ross 1969). If func = "nj" uses the original neighbor-joining algorithm of Saitou & Nei (1987) (default). If func = "bionj" uses the modified neighbor-joining algorithm of Gascuel (1997). Any of the neighbor-joining options is usually preferred as they keep distances between species better than UPGMA or MST (Cardoso et al. 2024). If func = "best", chooses the best of the options above based on maximum tree.quality values. If NJ trees are built, the root will be set at the node closest to the midpoint between the two most dissimilar species in the tree or, if root not NULL, at the node provided in parameter root (Podani et al. 2000).
A phylo object representing a functional tree.
Cardoso et al. (2014) Partitioning taxon, phylogenetic and functional beta diversity into replacement and richness difference components. Journal of Biogeography, 41: 749-761.
Cardoso et al. (2024) Calculating functional diversity metrics using neighbor-joining trees. Ecography, 2024: e07156.
Criscuolo & Gascuel (2008) Fast NJ-like algorithms to deal with incomplete distance matrices. BMC Bioinformatics, 9: 166.
Gascuel (1997) BIONJ: an improved version of the NJ algorithm based on a simple model of sequence data. Molecular Biology and Evolution, 14: 685–695.
Podani et al. (2000) Additive trees in the analysis of community data. Community Ecology, 1, 33–41.
Saitou & Nei (1987) The neighbor-joining method: a new method for reconstructing phylogenetic trees. Molecular Biology and Evolution, 4, 406–425.
trait = data.frame(body = c(NA,2,3,4,4), beak = c(1,1,1,1,2))
distance = gower(trait)
plot(tree.build(distance), "u")
plot(tree.build(distance, func = "bionj", fs = 1), "u")
plot(tree.build(distance, func = "best", root = 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.