Turn Notepad++ into an IDE for R.

Lately, I have been using Notepad++ as an R IDE. There are many reasons on why it might (or might not) be a good idea to abandon RStudio for a more lightweight option like Notepad++ for example. However, in this post I’m not gonna argue about which one is better, but rather I will show 3 easy steps we can follow in order to turn Notepad++ into a fully-functional IDE for R.

Assuming that Notepad++ is installed, the first thing we need to do is add auto-completion for R syntax because this can save a lot of time when programming lengthy scripts. Yihui Xie, a statistician and software engineer in RStudio, provides a useful R script in his GitHub page for this purpose: https://gist.github.com/yihui/2143971. What we need to do is simply load packages that we use most of time and for which we want to be able to have auto-completion, and then run his script. This will create an R.xml file which we then need to place inside the “autoCompletion” folder of the Notepad++ installation path. Finally, we need to download and install NppToR from Sourceforge: https://sourceforge.net/projects/npptor. The latter, allows us to pass code from Notepad++ into RGUI for execution – this is typically done by selecting the line(s) of code we want to run in the Notepad++ editor and hitting F8. That’s all!

Below, is a screenshot of working with Notepad++ as an IDE for R. The only thing I’m still missing (so much!) from RStudio is the view() function.