dot-splitByTab: Split elements of a vector into a data.frame

Description Usage Arguments Details Value Examples

Description

Split elements of a character vector by the tab separator

Usage

1
.splitByTab(x, firstRowToNames = TRUE, tab = "\\t")

Arguments

x

A character vector

firstRowToNames

logical Should the first element be used for column names

tab

character The string used torepresent the tab symbol

Details

This will split a vector into a data.frame checking that every line has the same number of separators. By default the first element will be set as the column names.

This is designed to take input from 'readLines()'

Value

A data frame

Examples

1
2
3
x <- c("ColA\tColB", "Value1\tValue2")
ngsReports:::.splitByTab(x, firstRowToNames = TRUE)
ngsReports:::.splitByTab(x, firstRowToNames = FALSE)

ngsReports documentation built on Nov. 23, 2020, 2:01 a.m.