Computes consensus edge lengths from a set of input trees using multiple methods.
consensus.edges(trees, method=c("mean.edge","least.squares"), ...)
An object of class "phylo"
with edge lengths.
object of class "multiPhylo"
in which the trees must have edge lengths. This could be, for instance, a sample from the posterior distribution of trees in a Bayesian analysis.
method for computing the edge lengths. Could be the mean of all trees in which the edge is present, or it could be the least-squares edge lengths computed on the mean patristic distance matrices from the input phylogenies in trees
. Note that in the latter case the phangorn function nnls.tree
is used and the option rooted
will be set to is.rooted(tree)
for the consensus tree.
optional arguments, the most popular of which is consensus.tree
- a user supplied consensus tree. Another optional argument for method="mean.edge"
is if.absent
which tells the function how to include absent edges in the computation of average edge lengths. Possible values are "zero"
(the default) or "ignore"
.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.