Learn R Programming

blscrapeR (version 1.0.1)

bls_map_state: Cloropleth mapping of BLS data

Description

Return a ggplot object to render a cloropleth 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.

Usage

bls_map_state(map_data, fill_rate = NULL, labtitle = NULL)

Arguments

map_data
Dataframe to be used as the map's measures. Usually a result of calls to the get_bls_state() function but other dataframes, which include FIPS codes may be used as well.
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

See Also

https://cran.r-project.org/package=tigris

Examples

Run this code
## 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)



Run the code above in your browser using DataLab