Learn R Programming

choroplethr (version 4.0.0)

get_state_demographics: Get a handful of demographic variables on US States from the US Census Bureau as a data.frame.

Description

The data comes from the American Community Survey (ACS). The variables are total population and median household income.

Usage

get_state_demographics(endyear = 2013, span = 5)

Arguments

endyear

The end year for the survey

span

The span of the survey

Examples

Run this code
# \donttest{
# get some demographic data on US states from the 2010 5-year ACS
df = get_state_demographics(endyear=2010, span=5)

# A choropleth map shows the location of the values.
# Set the 'value' column to be the column we want to render.
df$value = df$median_hh_income
state_choropleth(df)
# }

Run the code above in your browser using DataLab