Experimental replacement for read.fwf
that runs much faster. Included in mvbutils
only to reduce dependencies amongst my other packages.
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 = "", ...)
character
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.
names for the columns that are NOT skipped
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 colClass
string starting POSIXct.
will trigger automatic conversion to POSIXct
, using the rest of the string as the format specifier. See also tz
.
are there any strings (other than NA) which should convert to NAs?
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
A data.frame
, as per read.fwf
and read.table
.
misc