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

.splitByTabR Documentation

Split elements of a vector into a data.frame

Description

Split elements of a character vector by the tab separator

Usage

.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 to represent 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

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


steveped/ngsReports documentation built on July 24, 2024, 10:45 a.m.