phyltree_paths {mvSLOUCH} | R Documentation |
Extract path information from a phylogenetic tree
Description
The function computes for each node its path to the root and
its distance to the root. It returns an “enhanced”
phylo
type tree.
Usage
phyltree_paths(phyltree)
Arguments
phyltree |
The phylogeny - an object of class |
Details
The function removes a root edge, i.e. $root.edge
if one is present.
Value
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 |
Note
The ape
and phangorn
packages include related tree manipulation functions.
Author(s)
Krzysztof Bartoszek
See Also
ape
, phangorn
Examples
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()))