blscrapeR
blscrapeR copied to clipboard
dateCast() on quarterly BED data
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.
Thank you. I'll look into this!
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 = "-"))
using this API how to extract unemployment by states . i can't find anywhere