findMRCA: Get the MRCA of a set of taxa

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/utilities.R

Description

This function returns the most recent common ancestor (node number) for a set of taxa. If tips=NULL will be redundant with mrca (for type="node") or vcv.phylo, but much slower (for type="height").

Usage

1
findMRCA(tree, tips=NULL, type=c("node","height"))

Arguments

tree

a phylogenetic tree as an object of class "phylo".

tips

a vector containing a set of tip labels.

type

either "node" to return the node of the MRCA; or "height" to return the height above the root of the MRCA of tips.

Details

If tips==NULL will return the result of a normal function call to mrca. If tips=NULL will return a matrix equal to vcv.phylo.

From phytools 0.5-66 findMRCA uses getMRCA in the ape package internally, which results in a big speed-up.

Value

The node number of the MRCA, or a matrix of node numbers (if tips==NULL) - for type="node"; or the height of the MRCA, or a matrix of heights (if tips==NULL) - for type="height".

Author(s)

Liam Revell [email protected]

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

findMRCA, mrca

Examples

1
2
tree<-pbtree(n=20)
anc<-findMRCA(tree,c("t1","t10","t15"))

liamrevell/phytools documentation built on Nov. 18, 2018, 4:18 p.m.