get_pums | R Documentation |
Load data from the American Community Survey Public Use Microdata Series API
get_pums(
variables = NULL,
state = NULL,
puma = NULL,
year = 2022,
survey = "acs5",
variables_filter = NULL,
rep_weights = NULL,
recode = FALSE,
return_vacant = FALSE,
show_call = FALSE,
key = NULL
)
variables |
A vector of variables from the PUMS API.
Use |
state |
A state, or vector of states, for which you would like to
request data. The entire US can be requested with |
puma |
A vector of PUMAs from a single state, for which you would like
to request data. To get data from PUMAs in more than one state, specify a
named vector of state/PUMA pairs and set |
year |
The data year of the 1-year ACS sample or the endyear of the 5-year sample. Defaults to 2022. Please note that 1-year data for 2020 is not available in tidycensus, so users requesting 1-year data should supply a different year. |
survey |
The ACS survey; one of either |
variables_filter |
A named list of filters you'd like to return from the
PUMS API. For example, passing |
rep_weights |
Whether or not to return housing unit, person, or both
housing and person-level replicate weights for calculation of standard
errors; one of |
recode |
If TRUE, recodes variable values using Census data dictionary
and creates a new |
return_vacant |
If TRUE, makes a separate request to the Census API to retrieve microdata for vacant housing units, which are handled differently in the API as they do not have person-level characteristics. All person-level columns in the returned dataset will be populated with NA for vacant housing units. Defaults to FALSE. |
show_call |
If TRUE, display call made to Census API. This can be very useful in debugging and determining if error messages returned are due to tidycensus or the Census API. Copy to the API call into a browser and see what is returned by the API directly. Defaults to FALSE. |
key |
Your Census API key. Obtain one at https://api.census.gov/data/key_signup.html |
A tibble of microdata from the ACS PUMS API.
## Not run:
get_pums(variables = "AGEP", state = "VT")
get_pums(variables = "AGEP", state = "multiple", puma = c("UT" = 35008, "NV" = 00403))
get_pums(variables = c("AGEP", "ANC1P"), state = "VT", recode = TRUE)
get_pums(variables = "AGEP", state = "VT", survey = "acs1", rep_weights = "person")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.