Learn R Programming

pctax (version 0.1.7)

df2tree: From a dataframe to construct a phylo

Description

NOTE: this function will do before_tree first.

Usage

df2tree(data, edge_df = FALSE, ignore_pattern = NULL)

Value

phylo object

Arguments

data

dataframe

edge_df

if the data is edge_df ?

ignore_pattern

An optional regular expression pattern to match tip or node labels for dropping.

Examples

Run this code
data(otutab, package = "pcutils")
df2tree(taxonomy) -> tax_tree
print(tax_tree)
# check all nodes matched!
if (requireNamespace("picante")) {
  picante::match.phylo.comm(tax_tree, t(otutab)) -> nn
  nrow(nn$comm) == nrow(t(otutab))
}

Run the code above in your browser using DataLab