imfr-deprecated: List IMF database IDs

imf_idsR Documentation

List IMF database IDs

Description

The functions listed below are deprecated and will be defunct in the near future. When possible, alternative functions with similar functionality are also mentioned. Help pages for deprecated functions are available at help("<function>-deprecated").

Usage

imf_ids(return_raw = FALSE, times = 3)

imf_codelist(database_id, return_raw = FALSE, times = 3)

imf_codes(codelist, return_raw = FALSE, times = 3)

imf_data(
  database_id,
  indicator,
  country = "all",
  start = 2000,
  end = format(Sys.Date(), "%Y"),
  freq = "A",
  return_raw = FALSE,
  print_url = FALSE,
  times = 3
)

imf_metastructure(database_id, return_raw = FALSE, times = 3)

imf_metadata(database_id, URL, times = 3, ...)

Arguments

return_raw

logical. Whether to return the raw metadata structure list or a data frame with codelist codes and descriptions.

times

numeric. Maximum number of requests to attempt.

database_id

character string. database_id to request the header for. Can be found using imf_databases.

codelist

character string of a codelist from imf_codelist.

indicator

character string or character vector of indicator IDs. These can be found using imf_codes.

country

character string or character vector of ISO two letter country codes identifying the countries for which you would like to download the data.See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. If country = 'all' then imf_data will attempt to download all available countries.

start

year for which you would like to start gathering the data.

end

year for which you would like to end gathering the data.

freq

character string indicating the series frequency. With 'A' for annual, 'Q' for quarterly, and 'M' for monthly.

print_url

logical. Whether to print the URL used in the API call. Can be useful for debugging.

URL

character string. Used internally by imf_databases to request header by request URL rather than by database_id.

Value

If return_raw = FALSE then a data frame with the database IDs and descriptions is returned. If return_raw = TRUE then the raw dataflow list is returned.

If return_raw = FALSE then a data frame with the codelist IDs and descriptions is returned. If return_raw = TRUE then the raw data structure list is returned.

If return_raw = FALSE then a data frame with the codes and descriptions is returned. If return_raw = TRUE then the raw code list is returned.

If return_raw = FALSE then a data frame with just the requested data series are returned. If return_raw = TRUE then the raw data list is returned. This can include additional information about the series.

If return_raw = FALSE then a data frame with the codelist IDs and descriptions is returned. If return_raw = TRUE then the raw data structure list is returned.

imf_ids

For imf_ids, use imf_databases.

imf_codelist

For imf_codelist, use imf_parameters.

imf_codes

For imf_codes, use imf_parameters.

imf_data

For imf_data, use imf_dataset.

imf_metastructure

Function imf_metastructure will be discontinued in a future version for lack of evident use cases.

imf_metadata

Function imf_metadata is deprecated and will be discontinued in a future version. Use imf_dataset(include_metadata = TRUE) instead.

Examples

suppressWarnings(databases <- imf_ids())

#' # Find Primary Commodity Price System database data structure
suppressWarnings(cl <- imf_codelist(database_id = 'PCPS'))

# Retrieve indicators from BOP database
suppressWarnings(codes <- imf_codes(codelist = 'CL_INDICATOR_BOP'))

# Download Real Effective Exchange Rate (CPI base) for China at an annual
# frequency since 2018
suppressWarnings(df <- imf_data(database_id = 'IFS', indicator = 'EREER_IX',
                 country = 'CN', freq = 'A',start = 2018))

# Find Primary Commodity Price System database data structure
suppressWarnings(metastruc <- imf_metastructure(database_id = 'PCPS'))

# Find Primary Commodity Price System database metadata
suppressWarnings(metadata <- imf_metadata(database_id = 'PCPS'))


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