sepguesser: Make an educated guess on the separator character

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

This function tries to guess which separator was used in a text delimited file

Usage

1
sepguesser(file, sep_list = c(",", "\t", ";", " "))

Arguments

file

The name of the file which the data are to be read from

sep_list

A vector containing the candidates for being identified as separators. Defaults to c(",", "\t", ";"," ")

Value

A character value, corresponding to the guessed separator. One of "," (comma), "\t" (tab), ";" (semicolon)," " (whitespace)

Examples

1
2
3
4
5
6
sepguesser(system.file("extdata/design_commas.txt",package = "ideal"))
sepguesser(system.file("extdata/design_semicolons.txt",package = "ideal"))
sepguesser(system.file("extdata/design_spaces.txt",package = "ideal"))
mysep <- sepguesser(system.file("extdata/design_tabs.txt",package = "ideal"))

# to be used for reading in the same file, without having to specify the sep

ideal documentation built on Nov. 8, 2020, 5:02 p.m.