qcew_api: Request data from the Quarterly Census of Employment and...

View source: R/qcew_api.R

qcew_apiR Documentation

Request data from the Quarterly Census of Employment and Wages.

Description

Return data from the QCEW API. This is separate from the main BLS API and returns quarterly data sliced by industry, area or size. Industry is identified by NIACS code and area is identified by FIPS code. A key is not required for the QCEW API.

Usage

qcew_api(
  year = c(format(Sys.Date(), "%Y")),
  qtr = "1",
  slice = NULL,
  sliceCode = NULL,
  ...
)

Arguments

year

These data begin in 2012 and go to the most recent complete quarter. The argument can be entered as an integer or a character. The default is 2012.

qtr

Quarter: This can be any integer between 1 and 4, or "A" for annual. The argument can be entered as an integer or a character. The default is 1, which returns the first quarter.

slice

The slice should be one of the three data slices offered by the API; "industry", "area", or "size."

sliceCode

The slice codes depend on what slice you select. For example, if you select the "area" slice, your sliceCode should be a FIPS code. If you select "industry," your sliceCode should be a NIACS code. There are three internal data sets containing acceptable slice codes to help with selections; blscrapeR::niacs contains industry codes and descriptions, blscrapeR::area_titles contains FIPS codes and area descriptions, and blscrapeR::size_titles contains industry size codes. These codes can be used for the sliceCode argument.

...

additional arguments

Value

A tibble from the BLS API.

See Also

https://data.bls.gov/cew/doc/access/csv_data_slices.htm

Examples


 ## Not run: 
# A request for the employment levels and wages for NIACS 5112: Software Publishers.
dat <- qcew_api(c(format(Sys.Date(), "%Y")), qtr="1", slice="industry", sliceCode=10)

## End(Not run)


blscrapeR documentation built on Sept. 17, 2022, 1:05 a.m.