readTable {R.utils} | R Documentation |
Reads a file in table format
Description
Reads a file in table format and creates a data frame from it, with cases corresponding to lines and variables to fields in the file.
WARNING: This method is very much in an alpha stage. Expect it to change.
This method is an extension to the default read.table
function in R. It is possible to specify a column name to column class
map such that the column classes are automatically assigned from the
column header in the file.
In addition, it is possible to read any subset of rows. The method is optimized such that only columns and rows that are of interest are parsed and read into R's memory. This minimizes memory usage at the same time as it speeds up the reading.
Usage
## Default S3 method:
readTable(file, colClasses=NULL, isPatterns=FALSE, defColClass=NA, header=FALSE, skip=0,
nrows=-1, rows=NULL, col.names=NULL, check.names=FALSE, path=NULL, ...,
stripQuotes=TRUE, method=c("readLines", "intervals"), verbose=FALSE)
Arguments
file |
A |
colClasses |
Either a named or an unnamed |
isPatterns |
If |
defColClass |
If the column class map specified by a named
|
header |
If |
skip |
The number of lines (commented or non-commented) to skip before trying to read the header or alternatively the data table. |
nrows |
The number of rows to read of the data table.
Ignored if |
rows |
An row index |
col.names |
Same as in |
check.names |
Same as in |
path |
If |
... |
Arguments passed to |
stripQuotes |
If |
method |
If |
verbose |
Value
Returns a data.frame
.
Author(s)
Henrik Bengtsson
See Also
readTableIndex
().
read.table
.
colClasses
().