ces_download: Download data from the Current Employment Statistics (CES)...

Description Usage Arguments Details Value Examples

View source: R/ces.R

Description

ces_download retrieves and downloads data from the Current Employment Statistics (CES) database.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ces_download(
  bls_key,
  start_year,
  end_year,
  adjustment,
  industries,
  data_types,
  states,
  clean = TRUE
)

Arguments

bls_key

BLS API key for the user. See vignette.

start_year

Year to start data download.

end_year

Year to end data download.

adjustment

Character vector. Seasonal adjustment ("S") or not ("U") or both.

industries

Character vector. See vignette. List of available industries given in ces_national_codes_list or ces_state_codes_list datasets.

data_types

Character vector. Desired output. See series vignette. List of available data_types given in ces_national_codes_list or ces_state_codes_list datasets.

states

Optional character vector. See vignette. Leave blank for total US. List of states given in ces_national_codes_list or ces_state_codes_list datasets.

clean

Optional logical. Whether to clean the data into usable format or not. Defaults to TRUE.

Details

This function constructs BLS series IDs for a chosen set of parameters and then downloads the data from the CES database. This function also cleans the data and appends on identifiers for easy panel formatting.

Value

Cleaned data frame of CES data.

Examples

1
2
ces_df = ces_download(bls_key = Sys.getenv("BLS_KEY"), start_year = 2010, end_year = 2015,
adjustment = "U", industries = "05000000", data_types = c("01", "03", "11"), states = "1900000")

davidsovich/blsr documentation built on March 23, 2021, 5:31 a.m.