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
)
A data.frame with a column named "region" and a column named "value".
The name of the state. See ?state.regions for proper spelling and capitalization.
An optional title for the map.
An optional name for the legend.
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.
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".
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".
If true, render the choropleth over a reference map from Google Maps.
https://www.census.gov/data/academy/data-gems/2018/tract.html for more information on Census Tracts