Learn R Programming

bread (version 0.4.1)

bsep: Tries to identify the separator / delimiter used in a table format file

Description

The function reads the first row and tests the following common separators by default: ';' '\t' ' ' '|' ':' ','

Usage

bsep(file, ntries = 10, separators = c(";", "\t", " ", "|", ":", ","))

Value

A string

Arguments

file

String. Name or full path to a file compatible with data.table::fread()

ntries

Numeric. Number of rows to check for

separators

Vector of strings. Additional uncommon delimiter to check for

Examples

Run this code
file <- system.file('extdata', 'test.csv', package = 'bread')
## Checking the delimiter on the first 12 rows, including headers
bsep(file = file, ntries = 12)

Run the code above in your browser using DataLab