beaGet: Pass list of user specifications (including API key) to...

Description Usage Arguments Value Examples

Description

Pass list of user specifications (including API key) to return data from BEA API. . Method taken from https://github.com/us-bea/beaR/blob/master/R/beaGet.r

Usage

1
2
beaGet(beaSpec, asString = FALSE, asList = FALSE, asTable = TRUE,
  asWide = TRUE, isMeta = FALSE, iTableStyle = TRUE)

Arguments

beaSpec

A list of user specifications (required). In this example, 'GetData' specifies that we want data values (rather than metadata), 'NIPA' specifies the dataset, 'A' specifies that we want annual data, 'TableID' = '68' gets a specific table, and 'X' gets all years. See BEA API documentation or use metadata methods for complete lists of parameters.

asString

Return result body as a string (default: FALSE)

asList

Return result body as a list (default: FALSE)

asTable

Return result body as a data.table (default: TRUE)

asWide

Return data.table in wide format (default: TRUE)

isMeta

Special parameter meant to interact with metadata functions (default: FALSE)

iTableStyle

If "asWide = TRUE", setting "iTableStyle = TRUE" will return data.table in same format as shown on BEA website, with dates and attributes as column headers and series as rows; otherwise, results have series codes as column headers (default: TRUE)

Value

By default, an object of class 'data.table'

Examples

1
2
3
4
5
6
7
userSpecList <- list('UserID' = 'yourAPIKey' ,
								'Method' = 'GetData',
								'datasetname' = 'NIPA',
								'Frequency' = 'A',
								'TableID' = '68',
								'Year' = 'X')	
BDT <- beaGet(userSpecList, asTable = TRUE)

CommerceDataService/eu.us.opendata documentation built on May 6, 2019, 12:49 p.m.