blscrapeR icon indicating copy to clipboard operation
blscrapeR copied to clipboard

dateCast() on quarterly BED data

Open asavagar opened this issue 5 years ago • 3 comments

df <- bls_api(c("BDS0000000000000000120007LQ5"),
              startyear = 2008, endyear = 2017) %>%
    # Add time-series dates
    dateCast()

The data frame contains 'year' and 'period' columns as returned by the bls_api() function. The 'period' column is Q01, Q02, Q03 or Q04 which dateCast() incorrectly casts to months. For example, year 2010 and period Q03 will cast to date 2010-03-01.

Great package. Thank you.

asavagar avatar Mar 27 '19 15:03 asavagar

Thank you. I'll look into this!

keberwein avatar Mar 28 '19 12:03 keberwein

My workaround to dateCast.R for quarterly time series

df$date <- as.Date(paste(df$year, ifelse(df$period == "M13", 12,
 as.numeric(substr(df$period, 2, 3)))*3, "01", sep = "-"))

asavagar avatar Apr 14 '19 15:04 asavagar

using this API how to extract unemployment by states . i can't find anywhere

Bhabukpokharel avatar Apr 23 '19 07:04 Bhabukpokharel