eia_facets: EIA facets

View source: R/facets.R

eia_facetsR Documentation

EIA facets

Description

Obtain facets for a given set of EIA data.

Usage

eia_facets(dir, facet, tidy = TRUE, cache = TRUE, key = eia_get_key())

Arguments

dir

character, directory path.

facet

character

tidy

logical, return a tidier result. See details.

cache

logical, cache result for duration of R session using memoization. See details.

key

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

Details

By default, additional processing is done to return a list containing tibble data frames. 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.

Set to cache = FALSE to force a new API call for updated data. Using FALSE always makes a new API call and returns the result from the server. TRUE uses memoization on a per R session basis, caching the result of the function call in memory for the duration of the R session. You can reset the entire cache by calling eia_clear_cache().

Value

data frame, list, or character; see details.

Examples

## Not run: 
eia_facets("electricity/retail-sales", facet = "sectorid")

## End(Not run)

eia documentation built on Nov. 18, 2023, 1:07 a.m.