matTree: Transform a phylo object into a matrix.

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
matTree(tree)

Arguments

tree

A phylo object

Value

A matrix

Author(s)

Ruizhu Huang

Examples

1
2
3
4
5
6
7
8
9
library(ggtree)

ggtree(exTree, branch.length = 'none') +
 geom_text2(aes(label = node))

data(exTree)
# 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 = exTree)

markrobinsonuzh/treeAGG documentation built on May 26, 2019, 9:32 a.m.