Downloads and prepares race-by-geography tables from U.S. census data, using
the easycensus
package. Requires that an api key
be set up through easycensus::cens_auth()
in that package. Supports data
from the decennial census and the American Community Survey at a variety of
levels of geographic detail. The output of this function can be used directly
in bisg()
.
Arguments
- geo
The geographic level to return. Common options are listed in the function signature, but any of the geographies listed at
easycensus::cens_geo()
may be used.- ...
Further subgeographies to return, as in
easycensus::cens_geo()
.- year
The year for the data
- survey
The data product to use: either the decennial census (
"dec"
), or the the 1-year or 5-year ACS.- GEOIDs
If
TRUE
, return theGEOID
column as the unique geographic identifier; ifFALSE
, return a human-readable name. For example, withgeo="state"
, settingGEOIDs=FALSE
will return a column namedstate
with entries like"Massachusetts"
.- counts
If
TRUE
, return the table as actual population counts; ifFALSE
, return table as percentages within each geography.