td_fread: Read csv files fast using the data.table package and...

Description Usage Arguments Value

View source: R/td_fread.R

Description

A wrapper around data.table::fread() that automatically fills the col.names and colClasses parameters from a table design.

Usage

1
td_fread(input, file, text, cmd, table_design, ...)

Arguments

input

A single character string. The value is inspected and deferred to either file= (if no \n present), text= (if at least one \n is present) or cmd= (if no \n is present, at least one space is present, and it isn't a file name). Exactly one of input=, file=, text=, or cmd= should be used in the same call.

file

File name in working directory, path to file (passed through path.expand for convenience), or a URL starting http://, file://, etc. Compressed files with extension ‘.gz’ and ‘.bz2’ are supported if the R.utils package is installed.

text

The input data itself as a character vector of one or more lines, for example as returned by readLines().

cmd

A shell command that pre-processes the file; e.g. fread(cmd=paste("grep",word,"filename")). See Details.

table_design

a table_design

...

passed on to data.table::fread()

Value

A data.table by default, otherwise a data.frame when argument data.table=FALSE.


s-fleck/tabde documentation built on April 4, 2021, 10:11 p.m.