View source: R/visualizations.R
ff_plot_census | R Documentation |
This function creates choropleth maps for census tract estimates.
ff_plot_census( data, col_census_name, col_estimate, title, reverse_colors = F, legend_suffix = NULL, legend_prefix = NULL )
data |
Name of the dataframe with data and shapefiles |
col_census_name |
column name as a string of the column with the census tract names |
col_estimate |
column name as a string of the column with the estimate we want to plot |
title |
title of plot |
reverse |
reverse the mapping of the colors to numbers (by default dark colors represent high numbers) |
choropleth map of census tracts and estimate
df <- tidycensus::get_acs(state = "NC", county = "Forsyth", geography = "tract", variables = "S2301_C03_001", geometry = TRUE) %>% dplyr::mutate(NAME = stringr::str_replace(", Forsyth County, North Carolina", "")) ff_plot_census(df, "NAME", "estimate", "Employment Rate", T, NULL, "%")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.