Load CDC Fixed-Width Data

load_data(
  path,
  meta,
  soffice = "C:/Program Files/LibreOffice/program/soffice.exe"
)

Arguments

path

the file path returned from download_cdc() or the URL to the zip file.

meta

the data_ object with the metadata needed to read the fixed width file format.

soffice

Character. Path to the LibreOffice executable. Only required for 1968-1972 natality files. Defaults to the standard Windows installation path. Linux/Mac users will need to override this (e.g. "/usr/bin/soffice" on Linux or "/Applications/LibreOffice.app/Contents/MacOS/soffice" on Mac).

Value

A tibble for standard datasets, or a named list with denominator and numerator tibbles for linked birth cohort data.

Details

Uses output from download_cdc() to load the data into R as a tibble. For most datasets this returns a single tibble. For linked birth/infant death cohort data (identified automatically from the URL), it returns a named list with two elements: denominator (all births) and numerator (linked infant death records only). See load_data_birth_cohort() for details on the den/num structure.

CDC natality files from 1968-1972 are distributed as Microsoft Publisher (.pub) files and require LibreOffice to convert. Conversion is handled automatically but takes 10-20 minutes. See convert_pub() for details.