Learn R Programming

blscrapeR (version 4.0.1)

dateCast: Cast a date column to data frame returned by the bls_api() function

Description

A helper function to create a continuous date from Year and Period columns.

Usage

dateCast(api_df = NULL, dt_format = NULL)

Value

A tibble from the source api_df with an additional date column based on the date format given in dt_format.

Arguments

api_df

The data frame you wish to cast a date column to. Be sure the data frame contains 'year' and 'period' columns as returned by the bls_api() function.

dt_format

A character string containing a valid date format. The default will return the ISO 8601 date format.

Examples

Run this code

## Cast a date column to data frame returned by the bls_api() function.
df <- bls_api("LAUCN040010000000005") %>%
dateCast()


Run the code above in your browser using DataLab