Description Usage Arguments See Also Examples
Create a choropleth of US Census Tracts in Utah
1 2 |
df |
A data frame with a column named "region" and a column named "value". Elements in the "region" column must exactly match how census tracts are labelled in the "region" column in ?ut.tract.regions |
title |
An optional title for the map. |
legend |
An optional name for the legend. |
num_colors |
The number of colors on the map. A value of 1 will use a continuous scale. A value in [2, 9] will use that many colors. |
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 ?ut.tract.regions. |
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 ?ut.tract.regions. |
reference_map |
If true, render the choropleth over a reference map from Google Maps. |
https://www.census.gov/geo/reference/gtc/gtc_ct.html for more information on Census Tracts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # zoom in on Salt Lake, which has FIPS code 49035
data(df_pop_ut_tract)
ut_tract_choropleth(df_pop_ut_tract,
title = "2013 Salt Lake Census Tract\n Population Estimates",
legend = "Population",
county_zoom = 49035)
# add a reference map
ut_tract_choropleth(df_pop_ut_tract,
title = "2013 Salt Lake Census Tract\n Population Estimates",
legend = "Population",
county_zoom = 49035,
reference_map = TRUE)
## Not run:
ut_tract_choropleth(df_pop_ut_tract,
title = "2013 Utah Census Tract\n Population Estimates",
legend = "Population")
# 2013 per capita income estimate
data(df_ut_tract_demographics)
df_ut_tract_demographics$value = df_ut_tract_demographics$per_capita
ut_tract_choropleth(df_ut_tract_demographics,
title = "2013 Salt Lake Census Tract\n Per Capita Income",
legend = "Income",
num_colors = 4,
county_zoom = 49035,
reference_map = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.