epi_read: Read files with a consistent convenience function

View source: R/epi_read.R

epi_readR Documentation

Read files with a consistent convenience function

Description

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

Usage

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 <\url{https://github.com/AntonioJBT/episcout}>

See Also

fread, as.tibble.

Examples


## Not run: 
super_data <- epi_read('super_data.tsv')

## End(Not run)


AntonioJBT/episcout documentation built on Dec. 1, 2024, 4:07 a.m.