Learn R Programming

choroplethr (version 4.0.0)

get_acs_data: Use tidycensus to obtain the data needed to create a choropleth map.

Description

Use tidycensus to obtain the data needed to create a choropleth map.

Usage

get_acs_data(
  variable = NULL,
  tableId = NULL,
  column_idx = NULL,
  map,
  endyear,
  span,
  census_api_key,
  include_moe = FALSE
)

Arguments

variable

The variable you wish to plot. A list of available census variables can be obtained using tidycensus::load_variables()

tableId

Alternatively, you may specify the ACS table you wish to plot. If the table has more than one variable inside it, you must also specify the index of the column you wish to plot.

column_idx

The index of the desired column within the table.

map

The type map you wish to create; either 'state', 'county', 'zip', or 'tract'

endyear

The end year of the survey to use.

span

Either 1, 3, or 5, the ACS vintage you wish to use.

census_api_key

Optional. Census API keys can be obtained at: https://api.census.gov/data/key_signup.html

include_moe

Whether to include the 90 percent margin of error.