This function uses a table of fixed dates for operational-taxon-units (tip taxa) to calculate the absolute
age of the root divergence for a tree with branch lengths, and then appends this root age to the tree
as a $root.time
element, and then outputs the tree. Function setRootAges
is a wrapper for
setRootAge
for use with multiple trees in a "multiPhylo" object. This function was mainly written for
dealing with trees of extinct taxa dated in units of absolute time from Bayesian analyses, such as with MrBayes,
with trees scaled to time units by functions such as obtainDatedPosteriorTreesMrB
.
setRootAge(tree, fixedAges = NULL)setRootAges(trees, fixedAges = NULL)
A phylogeny with branch lengths of type "phylo".
A table of fixed ages for tip taxa, generally as a dataframe where the
first column is of type character, and the second column is of type numeric. = Such a table is automatically
generated as an attribute of the output from obtainDatedPosteriorTreesMrB
,
when argument getFixedTimes = TRUE
.
A list of type "multiPhylo" consisting of multiple phylogenetic trees with branch lengths.
The input tree is output, with a new $root.time
element.
Trees of fossil taxa come with one issue rarely encountered by those dealing with molecular phylogenies: the absolute timing of when tips and divergences is not certain. With the vast majority of molecular phylogenies, it can be assumed the youngest tips occur at 0 time -- i.e., the modern. This knowledge gives the tree an anchor for figuring out the absolute timing of events. Many programs and other software designed for depicting and analyzing phylogenetic hypotheses assumes such an apparent absolute time-scale (in R and elsewhere). A tree of Paleozoic brachiopods that include no extant members has no such anchor at time = 0, and such a default assumption in available software can be misleading. The $root.time protocol is intended to grant this absolute time-scale to a dated tree of fossil taxa, and is appended by most of the dating functions in package paleotree. However, trees dated by other approaches, such as via tip-dating in programs such as MrBayes and BEAST, will not have $root.time elements when read into R.
setRootAges
is designed to work by default with trees on relative
time-scales dated by obtainDatedPosteriorTreesMrB
, particularly
when the argument with getFixedTimes = TRUE
, which is used to obtain fixed tip
ages for anchoring the tree against an absolute time-scale. The functions described here
will be applied automatically with obtainDatedPosteriorTreesMrB
if argument getRootAges = TRUE
.
# NOT RUN {
set.seed(444)
tree <- rtree(10)
tipAges <- cbind(c("t1","t2"), c(15,10))
absTimeTree <- setRootAge(tree = tree,tipAges)
plot(absTimeTree)
axisPhylo()
# }
Run the code above in your browser using DataLab