get_qwi: Retrieve the Quarterly Workforce Indcator Data

View source: R/get_qwi.R

get_qwiR Documentation

Retrieve the Quarterly Workforce Indcator Data

Description

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.

Usage

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"
)

Arguments

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")

Value

the desired data from the US Census's Quaterly Workforce API as a tibble

Examples

## Not run: 
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")

## End(Not run)


medewitt/tidyqwi documentation built on April 29, 2024, 9:46 p.m.