matTree | R Documentation |
matTree
transforms a phylo tree into a matrix. The entry of the matrix
is node number. Each row represents a path connecting a leaf node and the
root. The columns are arranged in the order as the path passing the nodes to
reach the root.
matTree(tree)
tree |
A phylo object |
A matrix
Ruizhu Huang
library(ggtree)
data(tinyTree)
ggtree(tinyTree, branch.length = 'none') +
geom_text2(aes(label = node))
# each row of the matrix representing a path.
# the first column is leaf nodes; the last non-NA value in a row is the root
mat <- matTree(tree = tinyTree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.