The purpose of this function is to retrive firm information from the US Census' Quarterly Workforce Indicator API. These data can be retrieved with by specifying the states, the quarters, the years, and additional detail. This function can accept multiple states, years and quarters. This makes the data retrieval easier and stay inside of the US Census' limits on the API.
get_qwi( years, variables = NULL, quarters = c(1, 2, 3, 4), industry_level = 2, states, endpoint = "sa", all_groups = TRUE, owner_code = TRUE, geography = "cbsa", seasonadj = "U", apikey = NULL, processing = "sequential" )
years | years to fetch (e.g. 2010, or c(2010, 2011)) |
---|---|
variables | the variables you wish to fetch. Default is all. |
quarters | The quarters to fetch (e.g. c(1,2,3,4)) Default is all |
industry_level | Industries to fetch. Default is all level 2 |
states | state fips code to fetch |
endpoint | US Census endpoint designation. One of "sa" for Sex * Age, "se" for Sex by Education and "rh" for Race/Ethnicity |
all_groups | default to true |
owner_code | firm owner code |
geography | the US Census geography granuality (one of cbsa or county) |
seasonadj | seasonal adjustment factor (one of "U" or "S") |
apikey | your US Census API Key |
processing | the processing strategy (default = "sequential") |
the desired data from the US Census's Quaterly Workforce API as a tibble
if (FALSE) { library(tidyqwi) # One state, one year 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 = "sequential") # Multiple states. multiple years qwi_multi_year <- get_qwi(years = c("2010", "2011", "2012"), states = c("NC", "SC"), geography = "county", apikey = census_key, endpoint = "rh", variables = c("sEmp", "Emp"), all_groups = FALSE, industry_level = "2", processing = "sequential") }