Create a choropleth of Census Tracts in a particular state.

tract_choropleth(df, state_name, title = "", legend = "",
  num_colors = 7, tract_zoom = NULL, county_zoom = NULL,
  reference_map = FALSE)

Arguments

df

A data.frame with a column named "region" and a column named "value".

state_name

The name of the state. See ?state.regions for proper spelling and capitalization.

title

An optional title for the map.

legend

An optional name for the legend.

num_colors

The number of colors to use on the map. A value of 0 uses a divergent scale (useful for visualizing negative and positive numbers), A value of 1 uses a continuous scale (useful for visualizing outliers), and a value in [2, 9] will use that many quantiles.

tract_zoom

An optional vector of tracts to zoom in on. Elements of this vector must exactly match the names of tracts as they appear in the "region" column of the object returned from "get_tract_map".

county_zoom

An optional vector of county FIPS codes to zoom in on. Elements of this vector must exactly match the names of counties as they appear in the "county.fips.numeric" column of the object returned from "get_tract_map".

reference_map

If true, render the choropleth over a reference map from Google Maps.

See also

https://www.census.gov/geo/reference/gtc/gtc_ct.html for more information on Census Tracts