Retrieve American Community Survey data
Usage
tc_get_acs(
geography = NULL,
variables = NULL,
table = NULL,
year,
survey = c("acs5", "acs1", "acs3"),
product = c("detailed", "profile", "subject", "comparison"),
within = NULL,
predicates = NULL,
summary_var = NULL,
geometry = FALSE,
keep_geo_vars = FALSE,
key = tc_get_key(),
refresh = FALSE,
cache = TRUE,
ucgid = NULL,
geography_vintage = NULL,
...
)Arguments
- geography
Census geography name.
- variables
Optional character vector of variable names.
- table
Optional ACS table identifier. Mutually exclusive with
variables.- year
ACS year.
- survey
ACS survey, one of
"acs1","acs3", or"acs5".- product
ACS product, one of
"detailed","profile","subject", or"comparison".- within
Optional named list of parent geographies.
- predicates
Optional named list of additional predicates.
- summary_var
Optional summary variable to append as
summary_estimate/summary_moe.- geometry
Should geometry be joined after retrieval?
- keep_geo_vars
Should source geometry attributes be retained?
- key
Optional Census API key.
- refresh
Should cached metadata be refreshed?
- cache
Should discovery metadata be cached locally?
- ucgid
Optional
ucgidpredicate.- geography_vintage
Optional geography vintage used for input normalization.
- ...
Geography values such as
state = "NY"orcounty = "001".
Examples
if (FALSE) { # tinycensus::tc_has_key()
tc_get_acs(
year = 2024,
variables = "B01001_001E",
geography = "state",
state = c("NY", "Delaware")
)
}
