fread_chunked | R Documentation |
Works like read_delim_chunked
, but is built on
fread
. An advantage is that it is simpler to
programmatically read a selection of columns. However, it is much
slower.
fread_chunked( file, callback, chunk_size = 10000, progress = TRUE, return_chunks = FALSE, cmd = NULL, sep = "auto", sep2 = "auto", dec = ".", quote = "\"", na.strings = getOption("datatable.na.strings", "NA"), stringsAsFactors = FALSE, select = NULL, drop = NULL, colClasses = c("character"), integer64 = getOption("datatable.integer64", "integer64"), col.names, check.names = FALSE, encoding = "unknown", strip.white = TRUE, fill = FALSE, blank.lines.skip = FALSE, key = NULL, index = NULL, showProgress = getOption("datatable.showProgress", interactive()), data.table = getOption("datatable.fread.datatable", TRUE), logical01 = getOption("datatable.logical01", FALSE), keepLeadingZeros = getOption("datatable.keepLeadingZeros", FALSE), yaml = FALSE, tmpdir = tempdir(), tz = "", ... )
file |
File name in working directory, path to file (passed through |
callback |
A callback function to call on each chunk |
chunk_size |
The number of rows to include in each chunk |
progress |
bool. Display a progress message stating time taken after each chunk is processed. |
return_chunks |
bool. Save chunks and return as a single combined data
frame when function completes. Default is |
cmd |
A shell command that pre-processes the file; e.g. |
sep |
The separator between columns. Defaults to the character in the set |
sep2 |
The separator within columns. A |
dec |
The decimal separator as in |
quote |
By default ( |
na.strings |
A character vector of strings which are to be interpreted as |
stringsAsFactors |
Convert all character columns to factors? |
select |
A vector of column names or numbers to keep, drop the rest. |
drop |
Vector of column names or numbers to drop, keep the rest. |
colClasses |
As in |
integer64 |
"integer64" (default) reads columns detected as containing integers larger than 2^31 as type |
col.names |
A vector of optional names for the variables (columns). The default is to use the header column if present or detected, or if not "V" followed by the column number. This is applied after |
check.names |
default is |
encoding |
default is |
strip.white |
default is |
fill |
logical (default is |
blank.lines.skip |
|
key |
Character vector of one or more column names which is passed to |
index |
Character vector or list of character vectors of one or more column names which is passed to |
showProgress |
|
data.table |
TRUE returns a |
logical01 |
If TRUE a column containing only 0s and 1s will be read as logical, otherwise as integer. |
keepLeadingZeros |
If TRUE a column containing numeric data with leading zeros will be read as character, otherwise leading zeros will be removed and converted to numeric. |
yaml |
If |
tmpdir |
Directory to use as the |
tz |
Relevant to datetime values which have no Z or UTC-offset at the end, i.e. unmarked datetime, as written by |
... |
additional arguments passed on to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.