Skip to contents

This function retrieves the variables related to race/ethnicity and total population for each county from the U.S Decennial Census (2020). These variables are then used to render a data table and a plot in the tool.

Usage

Get_Census_Vars_Decennial(df_locations)

Arguments

df_locations

Data frame of cities, counties and states within the range of a circle buffer determined by the location of nearest grocery stores. This data frame is inherited from the return of DSPGrocery::Create_Circle_Buffer as df_census_call.

Value

The output returns a data frame of the 2020 decennial census variables for race/ethnicity and total population for each county.

Details

This function receives the data frame of cities, counties and states within the circle buffer established by the market size spatial calculations and outputs census data for each county. This functions uses the Census API through the package TidyCensus to retrieve data using the function "get_decennial()"

Author

Aaron Null