A New R Package for Searching & Downloading World Bank Data

Skip to first unread message

Jesse Piburn

Apr 23, 2016, 9:04:24 AM4/23/16
to World Bank API
Thought I would share this here. This is the first R package I have released so any comments or suggestions are always welcome.

Here is a vignette on how to get started with the wbstats package if you are interested.


From a discussion on reddit, "how is this package different than WDI"....

sure. the WDI package is what wbstats was sort of born out of. I was using WDI and realized that there were some cool features of the World Bank API that the WDI package didn't access, such as support for languages other than English, monthly and quarterly data, the use of the most recent value and gapfill parameters, querying by region / income type, search across more fields such as source organization, and the data catalog API.

My first thought was to expand the WDI package but ended up rewriting everything under the hood to make it more efficient and fault tolerant and it didn't seem to me that the WDI package was still actively maintained. If you use wbstats it should remind you of WDI and that's on purpose. I liked the way you interfaced with WDI so I tried to keep that flavor and also make it easier for people who were using WDI to get started with wbstats.

A couple other features that wbstats has.... 1) is that when querying multiple attributes, they are returned in a long data format as apposed to wide. This makes it much easier to use packages such as dplyr or ggplot2 and 2) is the ability to return dates as POSIXct for easy integration into plotting and time-series analysis techniques. The POSIXct really comes in handy when using monthly or quarterly data, since the default format the the API returns are e.g. "2000M12" or "1999Q3"

hope this helps!

Reply all
Reply to author
0 new messages