R Tutorial for IMF Economists

Welcome to the IMF R Tutorial!

This website/book was put together by Bas Bakker and Greta Polo from the IMF’s Western Hemisphere Department, with some early help from Shihui Liu.

We’re big fans of R and think the IMF should really start using it more for charts and data manipulation. We know R has a bit of a learning curve, and up until now, there haven’t been many examples of how to create IMF-style charts in R or easy-to-use templates. That’s why we wrote this book!

Why use R? It lets you make charts that look better and are more flexible than what you can do in Excel. Updating them is super easy—just rerun the code and you’re done in seconds. Combining data from different sources, like WEO and World Bank data, is straightforward and saves a ton of time. Plus, with AI tools around, writing and tweaking R code is way simpler now. You can even integrate charts directly into LaTeX documents. This book is here to help you get the most out of R.

Our goal is to help IMF economists (and others) build skills in using R for data analysis, visualization, econometrics, and more. We want to offer tutorials that are comprehensive, easy to follow, and practical, for both beginners and more experienced users. Everything is designed to be hands-on so you can apply it right away to your IMF work.

We’ll keep updating the book and adding new topics as we go.

If you have questions, suggestions, or spot any corrections needed, reach out to Bas at bbakker@imf.org or Greta at gpolo@imf.org.

Bas and Greta