fdply | R Documentation |
data.table
This function is useful to quickly glance at a big chunked file. It is similar
to the head()
function, except that it does not read the first few lines, but
rather the first few blocks of the file. By default, only the first block will be read;
it is not advisable to read a large number of blocks in this way because they may
occupy a lot of memory. The blocks are saved to a data.table
. See ?fplyr
for the definitions of chunked file and block.
fdply(
input,
nblocks = 1,
key.sep = "\t",
sep = "\t",
skip = 0,
colClasses = NULL,
header = TRUE,
stringsAsFactors = FALSE,
select = NULL,
drop = NULL,
col.names = NULL,
parallel = 1
)
input |
Path of the input file. |
nblocks |
The number of blocks to read. |
key.sep |
The character that delimits the first field from the rest. |
sep |
The field delimiter (often equal to |
skip |
Number of lines to skip at the beginning of the file |
colClasses |
Vector or list specifying the class of each field. |
header |
Whether the file has a header. |
stringsAsFactors |
Whether to convert strings into factors. |
select |
The columns (names or numbers) to be read. |
drop |
The columns (names or numbers) not to be read. |
col.names |
Names of the columns. |
parallel |
Number of cores to use. |
A data.table
containing the file truncated to the number of
blocks specified.
fdply: from file to data.table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.