tree.age: Extracting the age of nodes and tips in a tree.

View source: R/tree.age.R

tree.ageR Documentation

Extracting the age of nodes and tips in a tree.

Description

Extracting the age of each node and tip in a tree give the height of the tree or some specified age.

Usage

tree.age(tree, age, order = "past", fossil = TRUE, digits = 4)

Arguments

tree

A phylo object.

age

The age of the tree. If missing the age is set to be the tree height.

order

Either "past" if the units express time since the present (e.g. million years ago), or "present" if the unit is expressed in time since the root.

fossil

logical, whether to always consider the tree as containing at least one living taxa (TRUE) or allowing only fossil taxa (FALSE - default), see details.

digits

A numeric value or integer for the precision of the output.

Details

When fossil = TRUE, if the tree contains a tree$root.time element (for tree's root age), and that order is set to "past", the output ages are adjusted to be starting from the root.time. Else, if no tree$root.time exists or fossil = FALSE, tips and nodes age is relative from the tip furthest away from the root. THIS FUNCTION DOES NOT ESTIMATE TREE AGES, it just extracts branch length information and converts it into time units. For basic dating functions in R, check chronos, chronopl, chronoMPL or use more specialised dating software (e.g. MrBayes, BEAST, RAxML, etc.).

Author(s)

Thomas Guillerme

See Also

slice.tree, chrono.subsets.

Examples

## A dated random phylogeny with a root 50 units of time old.
tree.age(rtree(10), age = 50)
## A random tree with the distance since the root.
tree.age(rtree(10), order = 'present')


TGuillerme/dispRity documentation built on April 17, 2024, 10 p.m.