Fetch monthly LAUS data for a list of locations over a given time period, modeled after blscrapeR::bls_api
. Requires a BLS API key.
laus_trend(
names = NULL,
startyear,
endyear,
state = "09",
measures = "all",
annual = FALSE,
verbose = TRUE,
key = NULL
)
A character vector of place names to look up, either towns and/or counties.
Numeric; first year of range
Numeric; last year of range
A string: either name or two-digit FIPS code of a US state. Required; defaults "09"
(Connecticut).
A character vector of measures, containing any combination of "unemployment rate"
, "unemployment"
, "employment"
, or "labor force"
, or "all"
(the default) as shorthand for all of the above.
Logical: whether to include annual averages along with monthly data. Defaults FALSE
.
Logical: if TRUE
(default), this will print overview information about the series being used, as returned by the API.
A string giving the BLS API key. If NULL
(the default), will take the value in Sys.getenv("BLS_KEY")
.
A data frame, slightly cleaned up from what the API returns.
if (FALSE) {
laus_trend(c("Connecticut", "New Haven", "Hamden"), 2014, 2017, annual = TRUE)
}