

Working with R is very similar to a regular RStudio IDE R-extension provides the same support for installing packages, plots and plot viewer, global environment, datasets, plots, lists, variables, checking loaded packages etc. Some simple shortcuts like the pipe operator doesn’t work out of the box, so adding a shortcut for “%>%” or “|>” depending on your preference can be done using the following method: To eliminate any potential errors/code not work, you must make sure the R path is specified in the VSCode preferences (cmd+shift+p on mac) and search for R path.įinding the path is simple, open R and type:Īnother somewhat major tweak you would want to do to the editor: You can now start working with code but there are potentially times you could run into errors while running your code. Optional: You can install a better terminal alternative like radian, a debugger and a better plot-viewer like httpgd because the builtin plot-viewer for VSCode isn’t a particularly good one.


I am somewhat of a intermediate programmer who doesn’t use R as much as some people but whenever I do, RStudio is my preferred editor of choice. So, I will not be talking a lot about RStudio for that reason, but going into the strengths and weaknesses of VSCode compared to RStudio.įurther, this is a very brief overview comparing the community (free) versions of both editors, I cannot speak to the R-Studio paid editions. This writeup is for people who are very familiar with RStudio and want to see how the two compare. RStudio is the preferred IDE/Editor for running R code for most people, but VSCode has rapidly become one of the most popular code editors for a huge number of other languages.
