Download Census Race DataSource:
Downloads and prepares race-by-geography tables from U.S. census data, using
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
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
The year for the data
The data product to use: either the decennial census (
"dec"), or the the 1-year or 5-year ACS.
TRUE, return the
GEOIDcolumn as the unique geographic identifier; if
FALSE, return a human-readable name. For example, with
GEOIDs=FALSEwill return a column named
statewith entries like
TRUE, return the table as actual population counts; if
FALSE, return table as percentages within each geography.
A data frame with geographic identifier column(s) and six columns
black, etc. containing the counts or proportion of
residents in each racial group.