fast.read.fwf {mvbutils} | R Documentation |
Read in fixed-width files quickly
Description
Experimental replacement for read.fwf
that runs much faster. Included in mvbutils
only to reduce dependencies amongst my other packages.
Usage
fast.read.fwf(file, width,
col.names = if (!is.null(colClasses))
names( colClasses) else "V" %&% 1:ncol(fields),
colClasses = character(0), na.strings = character(0L), tz = "", ...)
Arguments
file |
character |
width |
vector of column widths. Negative numbers mean "skip this many columns". Use an NA as the final element if there are likely to be extra characters at the end of each row after the last one that you're interested in. |
col.names |
names for the columns that are NOT skipped |
colClasses |
can be used to control type conversion; see |
na.strings |
are there any strings (other than NA) which should convert to NAs? |
tz |
used in auto-conversion to |
... |
ignored; it's here so that this function can be called just like |
Value
A data.frame
, as per read.fwf
and read.table
.
misc