Learn R Programming

BLSloadR (version 0.2)

get_oews: Download Occupational Employment and Wage Statistics (OEWS) Data

Description

This function downloads and joins together occupational employment and wage data from the Bureau of Labor Statistics OEWS program. The data includes employment and wage estimates by occupation and geographic area. Note that OEWS is a large data set (over 6 million rows), so it will require longer to download.

Usage

get_oews(
  simplify_table = TRUE,
  suppress_warnings = TRUE,
  return_diagnostics = FALSE
)

Value

By default, returns a data.table with OEWS data. If return_diagnostics = TRUE, returns a bls_data_collection object containing data and comprehensive diagnostics. The columns in the returned data frame when `simplify_table = TRUE` are listed below. Unless otherwise specified, all data is returned as a character string to preserve the value of leading and trailing zeroes.

  • series_id - The unique OEWS series identifier.

  • year - The year to which the estimate refers. Because OEWS is not time series data, this is always the most recent year.

  • value - Numeric. The value of the given data type, for the given area, in the given industry and occupation.

  • seasonal - Whether or not the data is seasonally adjusted.

  • areatype_code - Code representing the type of area (National ("N"), Statewide ("S"), or Local ("M")).

  • industry_code - NAICS code of the industry.

  • occupation_code - SOC code of the occupation. Description given by occupation_name.

  • datatype_code - Lookup code for the data type of a given row. Description given by datatype_name.

  • state_code - Two-digit FIPS code for the state.

  • area_code - The unique OEWS code for a substate area. Description given by area_name.

  • series_title - Descriptive title of the full series ID.

  • occupation_name - The text description of the occupation.

  • occupation_description - More detailed description of the tasks associated with the occupation.

  • area_name - The text description of the area.

  • datatype_name - The text description of the type of data represented by `value`.

Arguments

simplify_table

Logical. If TRUE (default), remove columns from the result that are internal BLS references or can be derived from other elements in the table.

suppress_warnings

Logical. If TRUE (default), suppress individual download warnings and diagnostic messages for cleaner output during batch processing. If FALSE, returns the data and prints warnings and messages to the console.

return_diagnostics

Logical. If TRUE, returns a bls_data_collection object with full diagnostics. If FALSE (default), returns just the data table.

Examples

Run this code
# \donttest{
# Download current OEWS data
oews_data <- get_oews()

# View available occupations
unique(oews_data$occupation_name)

# Filter for specific occupation
software_devs <- oews_data[grepl("Software", occupation_name)]

# Get full diagnostic object if needed
oews_with_diagnostics <- get_oews(return_diagnostics = TRUE)
print_bls_warnings(oews_with_diagnostics)
# }

Run the code above in your browser using DataLab