learn_df: Learn from tree

View source: R/learn.R

learn_dfR Documentation

Learn from tree

Description

Learn initial data frame from Newick format tree leaves.

Usage

learn_df(tree, node = FALSE, tip = TRUE)

Arguments

tree

Newick tree file or phylo object.

node

a logical to control output with node label or not. The default value is FALSE.

tip

a logical to control output tip label or not.The default value is TRUE.

Value

a list containing

node

a data frame with id column. The id information is from the node label in Newick format tree file or phylo object. If the node parameter set as FALSE, the node information will be NULL.

tip

a data frame with id column. The id information is from the tip label in Newick format tree file or phylo object. If the tip parameter set as FALSE, the tip information will be NULL.

Examples

tree <- system.file("extdata",
                    "tree_of_itol_templates.tree",
                    package = "itol.toolkit")
sub_df <- learn_df(tree,node=TRUE,tip=TRUE)

itol.toolkit documentation built on Nov. 18, 2023, 5:11 p.m.