rhrReadData: read separator; delimited text files

Description Usage Arguments Details Value Examples

View source: R/rhrReadData.R

Description

Wrapper around readLines to read data with different field separators and run some checks, mainly used for the GUI

Usage

1
2
rhrReadData(file, sep = ",", skip = 0, hasHeader = TRUE, sepDec = ".",
  stringsAsFactors = FALSE, filename = NULL, ...)

Arguments

file

A character; the file name

sep

character; the separator

skip

numeric; the number of lines to skip

hasHeader

logical; indicates whether or not a header is presence

sepDec

character; indicating the decimal separator

stringsAsFactors

logical; indicating whether or not strings should be read as factors.

filename

character: if file and filename differ (e.g., when called through shiny)

...

passed to scan

Details

...

Value

object of class data.frame

Examples

1
2
3
4
5
6
7
8
## Not run: 
data(datSH)
write.csv(datSH, file.path(tempdir(), "file1.csv"), sep = ",", dec = ".")
dat <- rhrReadData(file.path(tempdir(), "file1.csv"), sep = ",", sepDec = ",")
head(dat)
rhr2md(dat)

## End(Not run)

jmsigner/rhr documentation built on June 26, 2020, 8:59 a.m.