learn_separator: Learn separator

View source: R/learn.R

learn_separatorR Documentation

Learn separator

Description

Learn 3 types of separators: tab, space, and comma.

Usage

learn_separator(lines = NULL, file = NULL)

Arguments

lines

a vector of character strings from template file. If the file parameter is NULL, this parameter should be set.

file

a character specifying the template file path. If this parameter is setted, the lines parameter will be replaced.

Value

a character specifying the separator

Examples

tree <- system.file("extdata",
                    "tree_of_itol_templates.tree",
                    package = "itol.toolkit")
data("template_groups")
df_group <- data.frame(id = unique(template_groups$group),
                       data = unique(template_groups$group))
## create unit
unit <- create_unit(data = df_group,
                    key = "Quickstart",
                    type = "DATASET_COLORSTRIP",
                    tree = tree)
## write unit
file <- tempfile()
write_unit(unit,file)
## Learn template type
learn_separator(file = file)

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