fast.read.fwf: 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
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 read.table
. It is an optional vector whose names must be part of col.names
. There is one extension of the read.table
rules:a co
na.strings
are there any strings (other than NA) which should convert to NAs?
tz
used in auto-conversion to POSIXct
when colClass
is set
...
ignored; it's here so that this function can be called just like read.fwf
Value
- A
data.frame
, as per read.fwf
and read.table
.
misc