bea2List: Convert BEA API httr response payload to list

Description Usage Arguments Value Examples

Description

Convert BEA API httr response payload to list

Usage

1
bea2List(beaPayload, isMeta = FALSE)

Arguments

beaPayload

An object with httr class 'response' from call to BEA API

isMeta

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

Value

An object of class 'list' of several dimensions. View list structure using 'str(yourList)'.

Examples

1
2
3
4
5
6
7
8
userSpecList <- list('UserID' = 'yourKey' ,
								'Method' = 'GetData',
								'datasetname' = 'NIPA',
								'Frequency' = 'A',
								'TableID' = '68',
								'Year' = 'X')
resp <- beaGet(userSpecList, asTable = FALSE)
BL <- bea2List(resp)

Example output

Loading required package: data.table
Creating a generic function for 'toJSON' from package 'jsonlite' in package 'googleVis'
Warning message:
In beaGet(userSpecList, asTable = FALSE) : Invalid API key: yourKey
Warning message:
In bea2List(resp) :
  Submitted variable is not a valid httr response class object.

bea.R documentation built on May 2, 2019, 1:30 p.m.

Related to bea2List in bea.R...