get_series_table: Retrieve a time series from BLS API as a tibble

View source: R/get_series_table.R

get_series_tableR Documentation

Retrieve a time series from BLS API as a tibble

Description

Retrieve a time series from BLS API as a tibble

Usage

get_series_table(
  series_id,
  api_key = bls_get_key(),
  start_year = NULL,
  end_year = NULL,
  year_limit = NULL,
  parse_values = TRUE,
  ...
)

Arguments

series_id

Character scalar BLS series ID

api_key

Optional. An API key string. Defaults to the value returned by bls_get_key(). The preferred way to provide an API key is to use bls_set_key() or the BLS_API_KEY environment variable. Manually passing the key will be deprecated in future releases.

start_year, end_year

numeric 4-digit years. While optional, they are strongly recommended. If one is provided, the other is mandatory. end_year must be greater than start_year

year_limit

optional number of years to paginate request by. If not explicitly set, it will be set to 10 or 20 depending on if an api_key is available

parse_values

optional boolean. If set to TRUE (default) it will attempt to parse the contents of value and cast numeric strings as numeric values. If set to FALSE it will retain value as a column of strings.

...

additional arguments to pass to get_series

Value

a tibble of observations or NA if the request had zero results.

See Also

Other blsR-requests: bls_request(), get_all_surveys(), get_latest_observation(), get_n_series_table(), get_n_series(), get_popular_series(), get_series_tables(), get_series(), get_survey_info(), reduce_spanned_responses(), span_series_request()

Examples

## Not run: 
get_series_table('LNS14000001',2005,2006)

## End(Not run)


blsR documentation built on July 9, 2023, 5:29 p.m.