I am trying to create an extract subset to industry and occupation codes:
ipums_acs_extract <- ipumsr::define_extract_usa(
description = "IND_OCC",
samples = "us2021c",
variables = list(
var_spec("IND", case_selections=7870),
var_spec("OCC", case_selections=2205)),
data_format = "csv",
data_structure = "rectangular",
rectangular_on = "P"
)
With integers in case_selections, I am getting
! Invalid `var_spec` specification:
x `case_selections` must be of type `character`, not `integer`.
With characters in case_selections, I am getting
! API request failed with status 400.
x Invalid general case selection of 2205 for variable OCC
x Invalid general case selection of 7870 for variable IND
Trying case_selection_type="detailed"
fails with
! API request failed with status 400.
x Detailed case selection made but detailed variable not found for IND.
x Detailed case selection made but detailed variable not found for OCC.
I understand that these are variables with hundreds of categories. But something fell between the cracks of the API vs. ipumsr
. These are valid codes as I can run the extract without them and filter()
just fine.
> packageVersion("ipumsr")
[1] ‘0.7.0’