Finds the most recent common ancestor (MRCA) for a pair of tip taxa.
fastMRCA(tree, sp1, sp2)
fastHeight(tree, sp1, sp2)
fastDist(tree, sp1, sp2)
The node number of the MRCA, the height above the root (for fastHeight
), or the patristic distance between two taxa (for fastDist
).
an object of class "phylo"
.
species one name.
species two name.
Liam Revell liam.revell@umb.edu
Function (fastMRCA
) returns the most recent common ancestor (node number) for a pair of taxa; or, in the case of fastHeight
, the height above the root of the MRCA of a pair of taxa; or, in the case of fastDist
, the patristic distance between a pair of taxa.
This function is mostly redundant with findMRCA
(or findMRCA(...,type="height")
in the case of fastHeight
), but for very large trees will be considerably faster.
(Also see getMRCA
in the ape package.)
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
getMRCA
, findMRCA
, mrca
## simulate 2000-tip tree
tree<-pbtree(n=2000)
## find the MRCA of two randomly chosen tips
tips<-sample(tree$tip.label,2)
anc<-fastMRCA(tree,tips[1],tips[2])
Run the code above in your browser using DataLab