laus_get_data: A wrapper function for blsAPI.R function that processes...

View source: R/laus_get_data.R

laus_get_dataR Documentation

A wrapper function for blsAPI.R function that processes gathered Labor Area Unemployment Statistics (LAUS) data into a data frame

Description

Allows users to request LAUS data and have it downloaded as a data frame with ease

Usage

laus_get_data(
  location.vector,
  measure.vector,
  start.year,
  end.year,
  api.version = 1,
  bls.key = NULL
)

Arguments

location.vector

A string or vector of the different cities, states or metropolitan statistical areas you want LAUS data from. To get help type help_laus_areacodes() to get a list of all of the area names that area associated to an area code in the LAUS data

measure.vector

A string of the laus measure you want to gather in your call, e.g. unemployment, unemployment rate.

start.year

The year you want as the beginning period of data collection

end.year

The year you want as the ending period of data collection

api.version

A numerical value that specifies which version of the api you're using (1 or 2). Default is version 1.

bls.key

The BLS key you're using to retrieve data using version 2

Examples

library(blsAPI)
library(dplyr)
library(rjson)
unem_df <- laus_get_data(location.vector = c("Florida", "California", 
                    "Charlotte County, FL", "Fresno County, CA"), 
                     measure.vector = "unemployment rate", 
                     start.year = 2019, end.year = 2021, 
                     api.version = 1)


mikeasilva/blsAPI documentation built on May 11, 2023, 4:57 a.m.