Skip to contents

Retrieve data from the IMF World Economic Outlook (WEO) database for specific series, countries, and years.

Usage

weo_get(series, countries, start_year = 1980, end_year = NULL, release = NULL)

Arguments

series

Character vector of series codes (from weo_list_series())

countries

Character vector of ISO country codes (from weo_list_countries())

start_year

Numeric: start year (default: 1980)

end_year

Numeric: end year (default: current year + 5)

release

Optional list with components 'year' and 'release' specifying WEO release to use. If NULL, uses latest available.

Value

A tibble with columns:

country_code

ISO 3-letter country code

country_name

Country name

series_code

WEO series code

series_name

Series name

units

Units of measurement

year

Year

value

Value

Examples

# Get GDP growth for selected countries
weo_get(
  series = "NGDP_RPCH",
  countries = c("USA", "GBR", "DEU"),
  start_year = 2015
)
#>  Available series: NGDP_R, NGDP_RPCH, NGDP, NGDPD, PPPGDP, NGDP_D, NGDPRPC, NGDPRPPPPC, NGDPPC, NGDPDPC, PPPPC, PPPSH, PPPEX, NID_NGDP, NGSD_NGDP, PCPI, PCPIPCH, PCPIE, PCPIEPCH, TM_RPCH, TMG_RPCH, TX_RPCH, TXG_RPCH, LP, GGR, GGR_NGDP, GGX, GGX_NGDP, GGXCNL, GGXCNL_NGDP, GGXONLB, GGXONLB_NGDP, GGXWDG, GGXWDG_NGDP, NGDP_FY, BCA, BCA_NGDPD, LUR, GGXWDN, GGXWDN_NGDP, LE, GGSB, GGSB_NPGDP, NGAP_NPGDP
#>  Requested series: NGDP_RPCH
#>  Filtered series: NGDP_RPCH
#> # A tibble: 45 × 7
#>    country_name country_code series_name          units series_code  year  value
#>    <chr>        <chr>        <chr>                <chr> <chr>       <int>  <dbl>
#>  1 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2015  1.66 
#>  2 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2016  2.29 
#>  3 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2017  2.71 
#>  4 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2018  1.12 
#>  5 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2019  0.993
#>  6 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2020 -4.1  
#>  7 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2021  3.67 
#>  8 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2022  1.37 
#>  9 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2023 -0.264
#> 10 Germany      DEU          Gross domestic prod… Perc… NGDP_RPCH    2024  0.007
#> # ℹ 35 more rows