split_str_to_list: split a dataframe contained one column

Description Usage Arguments Value Author(s) Examples

View source: R/taxa_utilities.R

Description

split a dataframe contained one column with a specify field separator character.

Usage

1
2
3
4
5
6
7
8
split_str_to_list(
  strdataframe,
  prefix = "tax",
  sep = "; ",
  extra = "drop",
  fill = "right",
  ...
)

Arguments

strdataframe

dataframe; a dataframe contained one column to split.

prefix

character; the result dataframe columns names prefix, default is "tax".

sep

character; the field separator character, default is "; ".

extra

character; See separate details.

fill

character; See separate details.

...,

Additional arguments passed to separate.

Value

data.frame of strdataframe by sep.

Author(s)

Shuangbin Xu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
otudafile <- system.file("extdata", "otu_tax_table.txt",
                      package="MicrobiotaProcess")
samplefile <- system.file("extdata",
                 "sample_info.txt", package="MicrobiotaProcess")
otuda <- read.table(otudafile, sep="\t", header=TRUE,
                    row.names=1, check.names=FALSE,
                    skip=1, comment.char="")
sampleda <- read.table(samplefile,
            sep="\t", header=TRUE, row.names=1)
taxdf <- otuda[!sapply(otuda, is.numeric)]
taxdf <- split_str_to_list(taxdf)
head(taxdf)

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.