knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

blsr

An R package for obtaining and cleaning data from the Bureau of Labor Statistics (BLS). This package uses the BLS API.

Highlights

Usage

A detailed usage description can be found in the vignette.

This package currently supports the following BLS databases:

In the near future, this package should also support these additional BLS databases:

Examples:

library(blscrapeR)


#Download data from CES

   # Custom CES state data series
   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"
   )

   # Pre-built CES seasonally adjusted non-farm payroll series
   ces_df = ces_emp(
      bls_key = Sys.getenv("BLS_KEY"),
      series = "nfp",
      start_year = 2010,
      end_year = 2015,
      adjustment = "S"
   )

   # Pre-built CES non-seasonally adjusted sector series
   ces_df = ces_emp(
      bls_key = Sys.getenv("BLS_KEY"),
      series = "super",
      start_year = 2010,
      end_year = 2018,
      adjustment = "U"
   )

#Download data from JOLTS

   # Custom JOLTS hire and quit rates and levels series
   jolts_df = jolts_download(
      bls_key = Sys.getenv("BLS_KEY"),
      start_year = 2010,
      end_year = 2015,
      adjustment = "S",
      industries = "000000",
      data_types = c("HI", "QU"),
      data_levels = c("R", "L")
   )

   # Pre-built JOLTS seasonally adjusted non-farm hires series
   jolts_df = jolts_hires(
      bls_key = Sys.getenv("BLS_KEY"),
      series = "nfp",
      start_year = 2010,
      end_year = 2015,
      adjustment = "S"
   )

   # Pre-built JOLTS non-seasonally adjusted sector separations series
   jolts_df = jolts_seps(
      bls_key = Sys.getenv("BLS_KEY"),
      series = "super",
      start_year = 2010,
      end_year = 2015,
      adjustment = "S"
   )


# Local area unemployment statistics

   # Custom LAUS data series
   laus_df = laus_download(
      bls_key = Sys.getenv("BLS_KEY"),
      start_year = 2010,
      end_year = 2015,
      adjustment = "S", 
      states = c("ST0100000000000", "ST0200000000000"), 
      data_types = c("03")
   )

   # Pre-built LAUS seasonally adjusted unemployment rate series
   laus_df = laus_urate(
      bls_key = Sys.getenv("BLS_KEY"),
      start_year = 2010,
      end_year = 2015,
      adjustment = "S"
   )

Installation

The blsr package is not available on CRAN. You can install the development version from Github:

library("devtools")
devtools::install_github("davidsovich/blsr")

Contact

dsovich AT uky.edu

History

Helpful links



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