knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of tidyqwi
is to make accessing the US Census Bureau's Quarterly Workforce Indicators easier in a tidy format.
This package allows a user to specify the years and states of interest as well as some of the additional parameters (desired cross tabs, MSA vs county level data, firm size, etc) and submit them to the US Census API.
This package then stays within the US Census guidelines for API submission for this data and returns a combined tidy dataframe for future analysis.
Install via CRAN with:
install.packages("tidyqwi")
Or the development version at:
remotes::install_github("medewitt/tidyqwi")
After installation you can load and retrieve the desired data!
library(tidyqwi) nc_qwi <- get_qwi(years = "2010", states = "11", geography = "county", apikey = census_key, endpoint = "rh", variables = c("sEmp", "Emp"), all_groups = FALSE, industry_level = "2", processing = "multiprocess")
library(tidyqwi)
And look at your data:
head(nc_qwi)
And there are labels added if desired
labelled_nc <- add_qwi_labels(nc_qwi)
Hmisc::describe(labelled_nc$Emp)
library(ggplot2) library(dplyr) labelled_nc %>% as_tibble() %>% dplyr::filter(county == "067") %>% ggplot(aes(year_time, Emp, color = county))+ geom_line()+ scale_y_log10()+ facet_wrap(~industry)+ labs( title = "Quarterly Workforce Indicators for Forsyth County", subtitle = attributes(labelled_nc$Emp)$label, caption = "Data: US Census Bureau QWI", x = "Month" )+ theme_minimal()
Please note that the 'tidyqwi' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.