get_geoids {sociome} | R Documentation |
Obtain GEOIDs of areas
Description
Returns a tibble
or sf
of GEOIDs, names, and
decennial census population of user-specified locations.
Usage
get_geoids(
geography,
state = NULL,
county = NULL,
geoid = NULL,
year = 2010,
geometry = FALSE,
cache_tables = TRUE,
key = NULL,
...
)
Arguments
geography |
A character string denoting the level of census geography
whose GEOIDs you'd like to obtain. Must be one of Note that block-level data cannot be obtained from 1990 and 2000 decennial
census data due to limitations in |
state , county , geoid , geometry , cache_tables , key |
See the descriptions of
the arguments in |
year |
Single integer specifying the year of US Census data to use.
Defaults to 2010. Based on this year, data from the most recent decennial
census will be returned (specifically, |
... |
Additional arguments to be passed to
|
Details
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.
Examples
## 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)