consensus.edges: Compute consensus edges for a tree under some criterion

View source: R/consensus.edges.R

consensus.edgesR Documentation

Compute consensus edges for a tree under some criterion


Computes consensus edge lengths from a set of input trees using multiple methods.


consensus.edges(trees, method=c("mean.edge","least.squares"), ...)



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".


An object of class "phylo" with edge lengths.


Liam Revell

phytools documentation built on Nov. 10, 2023, 1:08 a.m.