| get_geoids | R Documentation |
Returns a tibble or sf of GEOIDs, names, and
decennial census population of user-specified locations.
get_geoids(
geography = c("state", "county", "tract", "block group", "block", "zcta",
"zip code tabulation area"),
state = NULL,
county = NULL,
geoid = NULL,
zcta = NULL,
year,
dataset = c("acs5", "decennial", "acs3", "acs1"),
geometry = FALSE,
cache_tables = TRUE,
key = NULL,
evaluator = purrr::insistently(eval, rate = purrr::rate_delay(), quiet = FALSE),
...
)
geography |
A character string denoting the level of census geography
whose GEOIDs you'd like to obtain. Must be one of |
state |
A character string specifying states whose ADI and ADI-3 data is
desired. Defaults to If |
county |
A vector of character strings specifying the counties whose ADI
and ADI-3 data you're requesting. Defaults to |
geoid |
A character vector of GEOIDs (use quotation marks and leading
zeros). Defaults to |
zcta |
A character vector of ZCTAs or the leading digit(s) of ZCTAs (use
quotation marks and leading zeros). Defaults to Strings under 5 digits long will yield all ZCTAs that begin with those digits. Requires that |
year |
Single integer specifying the year of US Census data to use. |
dataset |
The data set used to calculate ADIs and ADI-3s. Must be one of
When The 2010 and 2020 decennial censuses did not include the long-form questionnaire used in the 1990 and 2000 censuses, so this function uses the 5-year estimates from the 2010/2020 ACS to supply the data not included in the decennial censuses. Important: data are not always available depending on the level of
geography and data set chosen. See |
geometry |
Logical value indicating whether or not shapefile data should
be included in the result, making the result an The shapefile data that is returned is somewhat customizable by passing
certain arguments along to the |
cache_tables |
The plural version of the |
key |
Your Census API key as a character string. Obtain one at
http://api.census.gov/data/key_signup.html. Defaults to |
evaluator |
A function that will evaluate the calls to the tidycensus
functions. Defaults to |
... |
Additional arguments to be passed to
|
This allows users to quickly obtain all GEOIDs in a specified location at a specific level of geography without having to manually look them up somewhere else.
This facilitates calls to get_adi() that involve somewhat complicated
reference areas.
dataset_year_geography_availability for usable combinations of
dataset, year, and geography.
## Not run:
# Wrapped in \dontrun{} because it requires a Census API key.
# Get all tract GEOIDs for Manhattan
tracts <- get_geoids(geography = "tract", state = "New York", county = "New York")
tracts
# Get all block GEOIDs for the fifth tract on that list
get_geoids(geography = "block", geoid = tracts$GEOID[5])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.