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

Description

Computes consensus edge lengths from a set of input trees using multiple 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.

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.


phytools documentation built on June 22, 2024, 10:39 a.m.