eia2tidy {RTL} | R Documentation |
EIA API call with tidy output
Description
Extracts data from the Energy Information Administration (EIA) API to tibble format with optional custom series name. Makes a clean wrapper for use with purrr for multiple series extraction. Query Browser at https://www.eia.gov/opendata/qb.php.
Usage
eia2tidy(ticker, key, name = " ")
Arguments
ticker |
EIA series name. |
key |
Your private EIA API token as character "yourapikey". |
name |
Name you want to give the series. Defaults to ticker if set to " " |
Value
A tibble object with class date for weekly, monthly, quarterly or annual data and class POSIXct for hourly. tibble
Author(s)
Philippe Cote
Examples
## Not run:
# Single Series
RTL::eia2tidy(ticker = "PET.MCRFPTX2.M", key = "yourapikey", name = "TexasProd")
# Multiple Series
# Use eia2tidy_all() or pivot_longer, drop_na and then pivot_wider to wrangled results.
## End(Not run)
[Package RTL version 1.3.5 Index]