Returns the Citizen Voting Age Population by Congressional District. A custom
call to get_acs_cces. In the output, cvap_total is the total CVAP of
all races, cvap_race is the count of CVAP for the given race, and cvap_frac
is the fraction.
get_acs_cvap(
race = "white",
varlab_df = ccesMRPprep::acscodes_df,
year = 2018,
states = NULL,
dataset = "acs1"
)Race of interest. Either "white" (for non-Hispanic Whites),
"hispanic", "black", "native" (for Native Americans including American
Indians and Alaskan Natives), "asian".
a dataframe that appends the categories based on the varcode
The year of the ACS to get. Because of data availability limitations, this is capped to 2010-2018.
A vector of states to subset to. Gets passed onto the new state
argument in tidycensus::get_acs(), which defaults to NULL.
Which type of ACS to get. Defaults to "acs1" for ACS-5 year.
Use "acs5" for 5-year.
Future versions will allow CVAP race fractions by geographies other than CD.
get_acs_cvap("white")
#> Getting data from the 2018 1-year ACS
#> The 1-year ACS provides data for geographies with populations of 65,000 and greater.
#> Error in get_census_api_key(key): A Census API key is required for tidycensus requests.
#> ℹ Get a Census API key at https://api.census.gov/data/key_signup.html, then pass
#> it to a tidycensus function with the `key` argument or store it for future
#> sessions with `census_api_key("YOUR KEY", install = TRUE)`.