Skip to content

Download and tidy data from the IMF World Economic Outlook

License

Notifications You must be signed in to change notification settings

MattCowgill/readweo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readweo

Lifecycle: experimental R-CMD-check

{readweo} is an R package that helps you download, import and tidy data from the IMF’s World Economic Outlook.

Installation

You can install {readweo} from GitHub with:

# install.packages("devtools")
devtools::install_github("MattCowgill/readweo")

{readweo} is not currently on CRAN. At present I do not plan to submit it to CRAN.

Usage

The package has one key function: read_weo().

You can use it like so:

library(readweo)
weo <- read_weo("Oct 2022")
weo
#> # A tibble: 308,014 × 13
#>    weo_count…¹ iso   weo_s…² country subje…³ subje…⁴ units scale count…⁵ estim…⁶
#>    <chr>       <chr> <chr>   <chr>   <chr>   <chr>   <chr> <chr> <chr>     <dbl>
#>  1 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  2 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  3 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  4 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  5 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  6 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  7 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  8 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#>  9 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#> 10 512         AFG   NGDP_R  Afghan… Gross … Expres… Nati… Bill… Source…    2020
#> # … with 308,004 more rows, 3 more variables: year <dbl>, value <dbl>,
#> #   weo_date <date>, and abbreviated variable names ¹​weo_country_code,
#> #   ²​weo_subject_code, ³​subject_descriptor, ⁴​subject_notes,
#> #   ⁵​country_series_specific_notes, ⁶​estimates_start_after

read_weo() returns a tidy (long) tibble.

You can use it like this:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(ggplot2)
weo %>% 
  filter(country %in% c("New Zealand", "Australia"),
         subject_descriptor == "Unemployment rate") %>% 
  ggplot(aes(x = year, y = value, col = country)) +
  geom_line() +
  geom_vline(aes(xintercept = estimates_start_after),
             linetype = 2) +
  theme_minimal() +
  labs(subtitle = "Unemployment rate with IMF forecast")

About

Download and tidy data from the IMF World Economic Outlook

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages