Reads an unzipped CDC vital statistics fixed-width file into a tibble, using a metadata table from this package to define the column positions, widths, and names. All columns are read as character to avoid silent coercion of coded numeric fields.

read_section(data_file, meta)

Arguments

data_file

Path to the unzipped fixed-width data file downloaded from the CDC vital statistics FTP server.

meta

A metadata tibble with columns start, end, and name defining the fixed-width layout, such as data_mortality_multiple_1969.

Value

A tibble with one row per death record and one column per field defined in meta. All columns are character type — use decode_preview() to decode coded fields into human-readable labels.

Examples

if (FALSE) { # \dontrun{
meta <- data_mortality_multiple_1969
mort1969 <- read_section(data_file, meta)
} # }