get_n_series | R Documentation |
Create and execute a query to retrieve one or more time series and their catalog data
get_n_series(
series_ids,
api_key = bls_get_key(),
start_year = NULL,
end_year = NULL,
year_limit = NULL,
span = TRUE,
catalog = FALSE,
calculations = FALSE,
annualaverage = FALSE,
aspects = FALSE,
series_limit = NULL,
...
)
series_ids |
a list or character vector of BLS time-series IDs. If the items are named then the names will be used in the returned list |
api_key |
Optional. An API key string. Defaults to the value returned by
|
start_year, end_year |
numeric 4-digit years. While optional, they are
strongly recommended. If one is provided, the other is mandatory. |
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 |
span |
when set to |
catalog |
boolean. If set to |
calculations |
boolean. If set to |
annualaverage |
boolean. If set to |
aspects |
boolean. If set to |
series_limit |
Maximum number of series to request in one API call
when |
... |
additional arguments to pass to |
a list of series results. Each element of the returned list is
a named list guaranteed to have two items, SeriesID
and data
and
optionally catalog
. The unnamed list data
will have 0 or more elements,
each one a named list representing an observation in the time series. Each
observation is guaranteed to include the elements year
, period
,
periodName
, value
, and footnotes
. Footnotes are a list of named lists.
The rest are scalar values. If the the most recent observation is included,
that observation will have an element named latest
which will contain the
text 'true
'. If calculations
or aspects
were requested they will be
present as named elements in each observation.
query_n_series
Other blsR-requests:
bls_request()
,
get_all_surveys()
,
get_latest_observation()
,
get_n_series_table()
,
get_popular_series()
,
get_series_tables()
,
get_series_table()
,
get_series()
,
get_survey_info()
,
reduce_spanned_responses()
,
span_series_request()
## Not run:
series_ids <- list(uer.men ='LNS14000001', uer.women = 'LNS14000002')
uer_series <- get_n_series(series_ids, 'your-api-key-here' )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.