epi_read: Read files with a consistent convenience function

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/epi_read.R

Description

epi_read() reads files with a consistent convenience function. Wraps as.tibble and data.table's fread.

Usage

1
2
3
epi_read(input_name = "", na.strings = c(-Inf, "NULL", NULL, ".", "",
  "NA", "NaN", NA, "<NA>"), header = TRUE, stringsAsFactors = FALSE,
  strip.white = TRUE, ...)

Arguments

input_name

file to read as a string

na.strings

as for data.table::fread() with extended defaults

header

as for data.table::fread(), default is TRUE

stringsAsFactors

as for data.table::fread(), default is also FALSE

strip.white

as for data.table::fread(), default is also TRUE

...

pass any other data.table::fread() parameters

Value

A tibble

Note

Other parameters as specified by data.table::fread() You are probably better off using the standard read.csv(), data.table::fread() or other functions unless you are reading in several similarly constructed files. Files are read with data.table first and then converted to a tibble. Columns will be read as integer, numeric or character only. White space is stripped. Strings are read as character only. Assumes the first row is a header.

Author(s)

Antonio Berlanga-Taylor <https://github.com/AntonioJBT/episcout>

See Also

fread, as.tibble.

Examples

1
2
3
4
## Not run: 
super_data <- epi_read('super_data.tsv')

## End(Not run)

AntonioJBT/episcout documentation built on Nov. 7, 2019, 5:34 p.m.