toTree {TreeSummarizedExperiment} | R Documentation |
toTree
translates a data frame to a phylo object
toTree(data, cache = FALSE)
data |
A data frame or matrix. |
cache |
A logical value, TRUE or FALSE. The default is FALSE. If TRUE,
the output 'phylo' has 6 elements (edge, tip.label, edge.length, Nnode,
node.label, and cache). The cache is a list that has the length
equals to the number of internal node, and each of its element stores the
descendant leaves. The list is named with the alias labels of internal
nodes. The alias labels are created by prefixing the node numbers with
|
The last column is used as the leaf nodes
a phylo object
Ruizhu HUANG
taxTab <- data.frame(R1 = rep("A", 5), R2 = c("B1", rep("B2", 4)), R3 = c("C1", "C2", "C3", "C3", "C4")) taxTab <- data.frame(R1 = rep("A", 5), R2 = c("B1", rep("B2", 2), NA, "B2"), R3 = c("C1", "C2", "C3", NA, "C4")) tree <- toTree(data = taxTab)