R Tutorial for IMF Economists

Welcome to the IMF R Tutorial!

This website/book was written by Bas Bakker and Greta Polo, in the IMF’s Western Hemisphere Department, with earlier assistance from Shihui Liu.

We love R, and wish the IMF would start using it for making charts and manipulating data. We recognize R has a steep learning curve, and so far there have been few examples of how to make IMF charts in R, nor templates that make everything a lot easier. That is why we wrote this book!

Why should you use R? R enables you to create charts that are more visually appealing and versatile than those made in Excel. Updating charts is effortless—rerunning the code takes seconds. Combining data from different sources, such as WEO and World Bank datasets, is straightforward, saving time and effort. With AI tools, generating and fine-tuning R code has never been easier, making complex tasks manageable and accessible. From seamless data analysis to integrating updated visuals directly into LaTeX documents, R offers a smarter, more efficient way to work. This book is here to help you unlock those possibilities.

Our mission is to empower IMF economists and those alike with the skills and knowledge to effectively use R for data analysis, visualization, econometrics and more. We aim to provide comprehensive, accessible, and practical tutorials that target both beginner and more advanced users. Our tutorials are designed to be practical and hands-on, ensuring that users can apply what they learn directly to their IMF related work.

We aim to continuously improve the book and add new topics.

If you have any questions or suggestions or corrections, please contact Bas (bbakker@imf.org), and Greta (gpolo@imf.org).

Bas and Greta