Skip to contents

This function fetches fixed assets data from the BEA API based on the specified parameters.

Usage

beaFixedAssets(TableName = "", Year = "", ResultFormat = "json", beaKey = NULL)

Arguments

TableName

A character string specifying the table name for the fixed assets data.

Year

A character string specifying the year(s) for which to retrieve data.

ResultFormat

A character string specifying the format of the results. Default is "json".

beaKey

An optional character string containing the BEA API key. If NULL, the function will attempt to retrieve the key using `getbeaKey()`.

Value

A tibble containing the retrieved fixed assets data. If an error occurs, it returns a tibble with error information.

Details

This function requires a valid BEA API key. If not provided, it attempts to retrieve one using `getbeaKey()`. If the API key is invalid, a warning is issued and an error message is returned.

Examples

if (FALSE) { # \dontrun{
# Fetch fixed assets data for a specific table and year
data <- beaFixedAssets(TableName = "FAAt201", Year = 2020)

# Fetch data with a custom API key
data <- beaFixedAssets(TableName = "FAAt201", Year = "2019-2020", beaKey = "your-api-key-here")
} # }