Read text file(s)
fread2(input, ..., data.table = FALSE,
nThread = getOption("bigreadr.nThread"))
Path to the file(s) that you want to read from. This can also be a command, some text or an URL. If a vector of inputs is provided, resulting data frames are appended.
Other arguments to be passed to data.table::fread.
Whether to return a data.table
or just a data.frame
?
Default is FALSE
(and is the opposite of data.table::fread).
Number of threads to use. Default uses all threads minus one.
A data.frame
by default; a data.table
when data.table = TRUE
.
tmp <- fwrite2(iris)
iris2 <- fread2(tmp)
all.equal(iris2, iris) ## fread doesn't use factors
#> [1] "Component \"Species\": Modes: character, numeric"
#> [2] "Component \"Species\": Attributes: < target is NULL, current is list >"
#> [3] "Component \"Species\": target is character, current is factor"