This package contains a data.frame called ?df_county_unemployment
which contains unemployment data on US Counties from 2000-2014. The data is annualized, which means that there is one data point per County per year:
library(rUnemploymentData) data(df_county_unemployment) ?df_county_unemployment head(df_county_unemployment)
region county.name state.name 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 1 1001 autauga alabama 6.1 6.4 5.9 5.4 4.4 5.0 3.4 3.5 2.8 3.4 3.6 3.7 4.4 4.6 4.3 3.2 2.9 2.8 4.5 2 1003 baldwin alabama 4.9 5.2 5.7 5.4 4.2 4.2 3.8 3.1 2.5 3.0 3.3 3.9 4.6 4.5 4.6 3.4 2.8 2.7 4.1 3 1005 barbour alabama 7.3 8.2 9.8 9.1 5.6 7.3 8.3 6.6 4.3 4.3 4.9 6.8 7.0 6.4 6.4 4.9 4.9 5.4 7.7 4 1007 bibb alabama 8.5 11.1 10.1 10.5 6.7 5.8 6.2 6.7 6.2 6.2 4.7 6.2 6.4 5.4 4.9 3.8 3.6 3.5 5.1 5 1009 blount alabama 5.9 5.4 5.6 4.8 3.7 3.9 2.8 2.7 2.9 2.5 3.1 3.3 4.9 4.2 3.7 3.1 2.8 2.7 4.1 6 1011 bullock alabama 11.7 17.8 13.7 13.5 12.6 15.0 12.8 9.4 9.4 9.1 7.6 9.1 9.3 10.0 10.4 8.1 7.7 8.2 9.3
The data was scraped from the US Bureau of Labor Statistics (BLS) Local Area Unemployment Statistics (LAUS) webpage on January 4, 2014 (http://www.bls.gov/lau/) with the function ?build_county_df
.
The easiest way to visualize the entire dataset is with a boxplot.
?boxplot boxplot(df_county_unemployment[, c(-1, -2, -3)], main = "USA County Unemployment Data", xlab = "Year", ylab = "Percent Unemployment")
This visualization shows you, by year, the distribution of the unemployment rate in each county. For example, the recession that began in 2009 is very clear in this graph.
This package also comes with a function to create choropleth maps of the data:
?county_unemployment_choropleth county_unemployment_choropleth(year=2013)
Choropleth maps are useful for understanding the geographic distribution of values. For example, in this map it is clear that – with some notable exceptions – in 2013 the unemployment rate was very low in the central part of the US.
A third option for visualizing the data is with an animated choropleth map:
?animated_county_unemployment_choropleth animated_county_unemployment_choropleth()
This function is commented out in the above example because the resulting image cannot render inside a vignette. If you are interested in this visualization, then please type the command locally. Note that it will write files to your local file system – see ?choroplethr_animate
in the choroplethr package for details.