bls_map_state | R Documentation |
Return a ggplot object to render a choropleth map with state outlines. The map files contain 2015 FIPS codes and can be used with any data set containing state FIPS codes. They can not be used with the leaflet package but the shape files can be downloaded from the Census website or with the tigris package. See the "Mapping BLS Data" vignette for this package.
bls_map_state( map_data, fill_rate = NULL, labtitle = NULL, lowFill = "green", highFill = "red" )
map_data |
Dataframe to be used as the map's measures. Usually a result of
calls to the |
fill_rate |
Column name from the dataframe that you want to use as a fill value. |
labtitle |
The main title label for your map passed as a string. The default is no title. |
lowFill |
The fill color of the lower values being mapped. The default color is green, but can be changed to any color accepted by
|
highFill |
The fill color of the higher values being mapped. The default color is green, but can be changed to any color accepted by
|
A ggplot2
object based on information provided by the map_data
argument.
https://cran.r-project.org/package=tigris
## Not run: # Downlaod employment statistics for April 2016. df <- get_bls_state("April 2016", seasonality = TRUE) # Map the unemployment rate from data set. bls_gg <- bls_map_state(map_data = df, fill_rate = "unemployed_rate", labtitle = "Unemployment Rate") bls_gg ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.