eia_updates: EIA data updates

Description Usage Arguments Details Value See Also Examples

View source: R/categories.R

Description

Obtain information on EIA data series updates for a given category to avoid having to make requests for data that have not been updated since your last request.

Usage

1
2
3
4
5
6
7
8
eia_updates(
  id = NULL,
  deep = FALSE,
  n = 50,
  start = 1,
  tidy = TRUE,
  key = eia_get_key()
)

Arguments

id

integer, category ID, may be a vector. If NULL, the API root category.

deep

logical, if TRUE, return information on all child series. If FALSE (default), return only for the category id.

n

integer, maximum number of rows of series to return. Defaults to 50; maximum permitted by the API is 10,000.

start

integer, row to start from, defaults to 1.

tidy

logical, return a tidier result. See details.

key

API key: character if set explicitly; not needed if key is set globally. See eia_set_key.

Details

This function returns paginated results of the most recent update dates for data series. n and start help with stepping through chunks.

If you need to know the most recent update stamps for a large set of series, you should use this function, which makes an API call specifically to the EIA updates endpoint for specific EIA categories by category ID. If you are only interested in update times for a specific set of series IDs, you can use eia_series_updates. Note that while this function accepts a vector of IDs for id, it must make one API call per ID.

By default, additional processing is done to return a tibble data frame. Set tidy = FALSE to return only the initial list result of jsonlite::fromJSON. Set tidy = NA to return the original JSON as a character string.

Value

a tibble data frame (or a list, or character, depending on tidy value)

See Also

eia_series_updates

Examples

1
2
3
4
5
## Not run: 
# use eia_set_key() to store stored API key
eia_updates(742, n = 5)

## End(Not run)

eia documentation built on Feb. 22, 2021, 9:09 a.m.