EIAdata-package | R Documentation |
This package allows the user to query categories, and import data, through the EIA's API. Resulting time series are objects of class xts. The EIA API offeres access to over a million unique time series. The package also contains a function which returns the latest EIA Natural Gas Storage Report.
Package: | EIAdata |
Type: | Package |
Version: | 0.1.2 |
Date: | 2022-01-10 |
License: | GPL-2 |
Matthew Brigida
Maintainer: Matthew Brigida <mdbrigida@gmail.com>
http://www.eia.gov/beta/api/
## Not run: # \dontrun is used here because the functions require a valid EIA API key. # While API keys are free, they are best kept private. # Be sure to load your EIA key. You can request one # here: http://www.eia.gov/beta/api/register.cfm key <- "your_key" # To see the top of the data category hierarchy. getCatEIA(key=key) # To see the subcategories and data sets in a particular category (for example 40827). getCatEIA(key=key, cat=40827) # To download and return a time series object of class xts # for example ELEC.PLANT.GEN.13-WAT-ALL.Q getEIA(ID = "ELEC.PLANT.GEN.13-WAT-ALL.Q", key = key) # The if the EIA series ID contains a "-", the function will replace # this with a ".". So the call above will return a time series of # class xts named ELEC.PLANT.GEN.13.WAT.ALL.Q ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.