toTree {TreeSummarizedExperiment}R Documentation

Translate a data frame to a phylo object

Description

toTree translates a data frame to a phylo object

Usage

toTree(data, cache = FALSE)

Arguments

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 alias_

Details

The last column is used as the leaf nodes

Value

a phylo object

Author(s)

Ruizhu HUANG

Examples


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)


[Package TreeSummarizedExperiment version 1.0.3 Index]