Gathering QWI Data Over Several Years for Multiple States

  collapse = TRUE,
  comment = "#>"


Sometimes one may want to collect data from multiple states over multiple years. To do this we recommend loading the following libraries:

library (tidyverse)

Then we can create the different combinations of year and state in order to submit to tidyqwi.

year <- c("2008", "2009", "2010","2011")
state <- c("01","02","04","05","06","08","09","10","11","12",

argList <- list(x = state, y = year)

arguments <- cross_df(argList)

Using the multiple processing function we can submit the following:


qwi_data <- map2(arguments$x, arguments$y, ~
                    states = .x,
                    years  = .y ,
                    industry_level = "2",
                    all_groups = FALSE,
                    endpoint = "se",
                    geography = "cbsa",
                    processing = "multiprocess",
                    apikey = APIkey))

After this function returns out values we can collapse these data into a single data set.

qwi_data <- purrr::map_dfr(qwi_data, as_tibble)

And then add the labels for our variables if desired.

qwi_data <- add_qwi_labels(qwi_data)

Try the tidyqwi package in your browser

Any scripts or data that you put into this service are public.

tidyqwi documentation built on May 4, 2020, 5:10 p.m.