cps_read_year {cpsvote} | R Documentation |
Load a single CPS file
Description
Read one year of data from the Current Population Survey
Usage
cps_read_year(
file,
cols = cpsvote::cps_cols,
names_col = "new_name",
year = as.numeric(stringr::str_extract(file, "\\d{4}"))
)
Arguments
file |
Where the fixed-width or zip/gz file for this year's data lives |
cols |
Which columns to read. This must be a data frame, with required
columns |
names_col |
The column in |
year |
Which year is being read; defaults to 4-digit year in file name |
Value
a data frame, with dimensions depending on the year and columns specified
[Package cpsvote version 0.1.0 Index]