View source: R/phyltree_paths.R
phyltree_paths | R Documentation |
The function computes for each node its path to the root and
its distance to the root. It returns an “enhanced”
phylo
type tree.
phyltree_paths(phyltree)
phyltree |
The phylogeny - an object of class |
The function removes a root edge, i.e. $root.edge
if one is present.
The function returns a phylo
type tree with the below additional
fields.
Ntips |
Number of tips on the tree. |
path.from.root |
A list of length equalling the number of nodes. Each
entry is a list made up of two fields |
time.of.nodes |
A vector of length equalling the number of nodes. Each
entry is the node's distance from the root. This is only calculated if the input
tree has the |
tree_height |
The height of the tree if it is ultrametric, otherwise the length of the longest path from root to tip. |
tip_species_index |
The node numbers corresponding to tip nodes, should equal |
internal_nodes_index |
The node numbers corresponding to internal nodes, should equal
|
root_index |
The node number corresponding to the root, should equal |
The ape
and phangorn
packages include related tree manipulation functions.
Krzysztof Bartoszek
ape
, phangorn
RNGversion(min(as.character(getRversion()),"3.6.1"))
set.seed(12345, kind = "Mersenne-Twister", normal.kind = "Inversion")
phyltree<-ape::rtree(5)
phyltree_augmented<-phyltree_paths(phyltree)
RNGversion(as.character(getRversion()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.