Skip to contents

Download CPS microdata

Usage

cps_download_data(
  path = cps_data_dir(),
  years = seq(1994, 2024, 2),
  overwrite = FALSE
)

Arguments

path

A file path (relative or absolute) where the downloads should go. Defaults to cps_data_dir(), which returns ~/cps_data unless overridden via options(cpsvote.datadir = "your/path").

years

Which years of data to download. Defaults to all even-numbered years from 1994 to 2024.

overwrite

Logical, whether to write over existing files or not. Defaults to FALSE.

Details

  • File names will be written in the style "cps_nov2024.zip", with the appropriate years.

  • The Voting and Registration Supplement is only conducted in even-numbered years (since 1964), so any entry in years outside of this will be skipped.

  • Currently the package only supports downloads from 1994 onwards, so any entry in years before 1994 will be skipped.

Examples

if (FALSE) { # \dontrun{
cps_download_data(years = 2016, overwrite = TRUE)
} # }