simple.fwf: read in files that are in fixed width format

Description Usage Arguments Value

Description

takes a simple matrix locating the variables of interest (created, eg, as a .csv file in excel) and composes a vector of widths suitable to be passed into read.fwf NOTE: for now, this can't handle a situation where the vardefs contains multiple variables using the same columns (ie, a fips state and county code)

Usage

1
  simple.fwf(vardefs, filename, ...)

Arguments

vardefs

a matrix (or data frame) with cols "begin", "size", and "varname" with the starting column, the variable width, and its name

filename

the file (in fixed-width format) to read in

...

other args to be passed along to read.fwf

Value

the dataframe from the fixed-width file


dfeehan/dhstools documentation built on May 15, 2019, 5:12 a.m.