imf_parameters: List parameters and parameter values for IMF API requests

View source: R/data_functions.R

imf_parametersR Documentation

List parameters and parameter values for IMF API requests

Description

List input parameters and available parameter values for use in making API requests from a given IMF database.

Usage

imf_parameters(database_id, times = 3)

Arguments

database_id

character string of a database_id from imf_databases.

times

numeric. Maximum number of API requests to attempt.

Details

Retrieves a list of data frames containing all possible input parameters for requests from a given database available through the IMF API. Each data frame in the returned list has an input_code column and a description column. Retrieve the list, filter each data frame for the parameters you want, and then supply the modified list object to the imf_dataset function as its parameters argument. Alternatively, individually supply input_code values from each data frame as arguments to imf_dataset.

Value

Returns a named list of data frames. Each list item name corresponds to an input parameter for API requests from the database. All list items are data frames, with an input_code column and a description column. The input_code column is a character vector of all possible input codes for that parameter when making requests from the IMF API endpoint. The descriptions column is a character vector of text descriptions of what each input code represents.

Examples

# Fetch the full list of indicator codes and descriptions for the Primary
# Commodity Price System database
params <- imf_parameters(database_id = 'PCPS')


christophergandrud/imfr documentation built on April 18, 2023, 11:25 a.m.