Learn R Programming

phytools (version 0.7-70)

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

Description

This function computes consensus edge lengths by different methods.

Usage

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

Arguments

trees

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

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

Value

An object of class "phylo" with edge lengths.