RStudio
RStudio is the most popular IDE (integrated development environment) for R. That basically means most people write and debug their R code inside this text editor. It’s also the editor the instructor and TAs will be using for demonstration. But you are free to use whatever editor you that makes you most productive. For experienced programmers Visual Studio Code might be a good alternative with the R extension.
Technically the editor’s name is RStudio Desktop, though people are used to call it RStudio, the name of the company behind it. In August 2022, the RStudio company announced that it will be renamed to Posit.
Installation
Install the latest version of RStudio Desktop at https://www.rstudio.com/products/rstudio/download/. Just click the “Download RStudio” button and follow the simple instructions that follow. There are no platform-dependent steps for installing RStudio.
Once you’ve installed RStudio, you can open it like any other program on your computer usually by clicking an icon on your desktop.
If everything goes well, you should see the following screen when opening RStudio.
Configuration
RStudio allows customization through global settings. Here I list some of my personal preferences for configuring RStudio, it is not required that you do the same.
Manage history
If you want every R session to be completed isolated from each other and no history being saved (which is a actually a good idea when it comes to coding, you should be saving the script anyway).
Open the optionsmenu from the menu bar via Tools -> Global Options
. In General -> Basic
uncheck
Restore .RData into workspace at startup
set
Save workspace to .RData on exit
toNever
uncheck
Always save history (even when not saving .Rdata)
Pane layout
Many times I with the my course code and R console to be displayed side by side, not on top of the other. You can set this in Pane Layout
in the options menu.
Text encoding
Set default text encoding to “UTF-8”