My RStudio Configuration

I help a few of dozen users install RStudio and learn R regularly. Whenever I need to install RStudio on a new machine, I have to think a bit about the configuration options I’ve tweaked. Invariably, I miss a checkbox that leaves me with slightly different RStudio behavior on each system. This post includes screenshots of my currently preferred standard RStudio configuration and custom keyboard shortcuts for RStudio 1.3, MacOS.

If you need an exact copy of your settings, consider the discussion at https://stackoverflow.com/questions/55903423/export-import-rstudio-user-preferences-global-setting-etc/55940249 (h/t: liebrr)

RStudio Tools, Global options, General, Basic tab

I prefer never to save the workspace and not to restore any workspace that might have been saved. That way, my environment is clean on each project launch and I can be confident that the results I’m observing aren’t an artifact of some previous session.

RStudio Tools, Global options, General, Advanced tab

Showing .Last.value in the Environment pane is a valuable debugging tool. Since the name begins with a period, this variable is hidden by default. However, RStudio lets me make it visible and it’s often helpful to have a quick check on the structure of the last evaluated expression.

RStudio Tools, Global options, Code, Editing tab

I prefer to use 2 spaces for indentation rather than tabs. A space is a space is a space in any text editor, but tabs can behave differently given different users’ and different text editors’ configurations.

RStudio Tools, Global options, Code, Display tab
RStudio Tools, Global options, Code, Saving tab
RStudio Tools, Global options, Code, Completion tab

I prefer not to have completion options popup on their own when I pause typing. I make too many accidental selections when they auto appear.

RStudio Tools, Global options, Code, Diagnostics tab

Show me all the diagnostic information! I can take it.

RStudio Tools, Global options, Appearance

I use the lovely FiraCode font which uses ligatures to enhance common programming sequences such as the assignment operator <- or inequality predicate !=

RStudio Tools, Global options, Pane layout tab

By placing the Source and Console side by side in the upper quadrants, I can maximize the vertical space available for each. The History and Connections panes are my least used panes, so I leave those under the left-hand Source pane so that my source files can be full height most of the time.

RStudio Tools, Global options, Packages management tab
RStudio Tools, Global options, Packages, Development tab
RStudio Tools, Global options, R Markdown tab
RStudio Tools, Global options, Sweave tab
RStudio Tools, Global options, Spelling tab
RStudio Tools, Global options, Git/SVN tab

Yes, you should use version control. Take the dive and learn about it.

RStudio Tools, Global options, Publishing tab
RStudio Tools, Global options, Terminal tab
RStudio Tools, Keyboard Shortcuts Customizations - Mac

On MacOS, my keyboard shortcuts concentrate common actions on the command key while on Windows, I use the ALT key (Alt+Up to clear the console; Shift+Alt+Up to restart the R session, Alt+Right to insert the magrittr pipe operator, etc.)