set.root.time: Adds root time to a tree

View source: R/set.root.time.R

set.root.timeR Documentation

Adds root time to a tree

Description

Adds or replace root time to a tree by calculating it's root's depth

Usage

set.root.time(tree, present = 0)

Arguments

tree

A phylo, mutiPhylo or dispRity object that contains trees.

present

The age of the most recent tip. By default this is set to 0.

Examples

## A random tree with no root.time
my_tree <- rtree(10)
my_tree$root.time # is NULL
## Adding a root time
my_tree <- set.root.time(my_tree)
my_tree$root.time # is not NULL
## Rewrite the root time with a different present
my_tree <- set.root.time(my_tree, present = 10)
my_tree$root.time # is older


TGuillerme/dispRity documentation built on Dec. 21, 2024, 4:05 a.m.