imf_data: Fetch data from any IMF data flow

View source: R/structure.R

imf_dataR Documentation

Fetch data from any IMF data flow

Description

The general-purpose accessor behind the database-specific wrappers. Supply a data flow id and a key. Use imf_dimensions() to discover the dimension order and imf_codelist() to discover valid codes.

Usage

imf_data(
  dataflow,
  key = NULL,
  agency = NULL,
  version = "+",
  start = NULL,
  end = NULL
)

Arguments

dataflow

Data flow id, for example "WEO" or "CPI".

key

Either a ready-made key string (for example "GBR.NGDP_RPCH.A"), or a list of values per dimension in order (for example list(c("GBR", "USA"), "NGDP_RPCH", "A")), or NULL for all series. An empty element is a wildcard for that dimension.

agency

Owning agency. If NULL it is looked up from the catalogue.

version

Data flow version; "+" (the default) requests the latest.

start, end

Optional first and last year to keep.

Value

An object of class imf_tbl (a data frame).

Examples


imf_data("WEO", "GBR.NGDP_RPCH.A", start = 2015, end = 2024)


readimf documentation built on June 15, 2026, 5:07 p.m.