christophergandrud / imfr

R package for interacting with the IMF RESTful JSON API
49 stars 5 forks source link

Fix/imf_data_one better not to stop, but go next iteration #20

Closed mitsuoxv closed 4 years ago

mitsuoxv commented 4 years ago

Thank you for merging my previous pull request. This is another one. Download for all countries, like the example below, sometimes fails. As imf_data_one function does for loop to transact 60 countries by each, the last iteration may have small number of countries and those countries may not have requested indicator or frequency. I would like to propose imf_data_one function will not stop, but go next iteration, when it finds unavailable indicator or frequency.

[failed example]

imf_data(database_id = "IFS",
               indicator = "GG_GALM_G01_XDC",
               country = "all",
               freq = "A",
               start = 1900, end = current_year()
)
christophergandrud commented 4 years ago

Thank you for the contribution! 🎉

I've merged it into main with 2a9a64892bb12db791ffc72bbf962d788d01fec7 and will work on getting it to CRAN.