match_all_calibrations {datelife} | R Documentation |
Match calibrations to nodes of a given tree
Description
match_all_calibrations
searches a given tree for the most recent common
ancestor (mrca) of all taxon name pairs in a datelifeCalibration
. It uses phytools::findMRCA()
.
Usage
match_all_calibrations(phy, calibrations)
Arguments
phy |
A |
calibrations |
A |
Details
The function takes pairs of taxon names in a secondary calibrations data frame,
and looks for them in the vector of tip labels of the tree. If both are present,
then it gets the node that represents the most recent
common ancestor (mrca) for that pair of taxa in the tree.
Nodes of input phy
can be named or not.
Value
A list of two elements:
- phy
A
phylo
object with nodes renamed withtree_add_nodelabels()
.- matched_calibrations
A
matchedCalibrations
object, which is the inputcalibrations
object with two additional columns storing results from the mrca search withphytools::findMRCA()
:$mrca_node_number
and$mrca_node_name
.