Description Usage Arguments Details Value See Also
Function to get the coalescent and sampling intervals of a binary tree (the function also works for serially-sampled trees). The function returns a table with each row representing one of the intervals in the tree. This can be used to get the vector of speciation/transmission and sampling times for a phylogenetic tree.
1 | getTreeIntervals(tree, decreasing = FALSE, raw = FALSE)
|
tree |
An object of class "phylo" from ape |
decreasing |
If FALSE intervals are ordered from the present into the past. If TRUE intervals are ordered from the tMRCA to the present. |
raw |
If TRUE return the raw table before reordering and calculating interval lengths or numbers of lineages. Mostly for debugging purposes. |
Each row of the output table represents an interval of the tree. Intervals are between successive nodes in the tree, with time measured from the present (t = 0) into the past. For an interval between time x and y, with x < y, the function returns
The node number of the node at time y in tree
.
The node type of the node at time y ("coalescent" for internal nodes and "sample" for leaves).
The height of the node at the end of the interval (y).
The length of the interval (y - x).
The number of lineages in the tree during the interval.
Rows are ordered based on the end time of the intervals. If two nodes have the same height, nodes are ordered by type ("coalescent" < "sample") and then by node number.
To get the tree interval the function performs a depth first traversal of the tree.
The results of this function are equivalent to getx
in the TreeSim
package, but more verbose.
A table with each row representing one of the tree intervals.
getBranchingTimes
, getSamplingTimes
,
getx
, branching.times
,
coalescent.intervals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.