My RStudio Configuration
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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 RStudio configuration and custom keyboard shortcuts for RStudio 1.3, MacOS, so that I have a reference.
![RStudio Tools, Global options, General, Basic tab](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/01-general-basic-1024x1004.png?resize=578%2C567&ssl=1)
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](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/02-general-advanced-1024x1004.png?resize=578%2C567&ssl=1)
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](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/03-code-editing-1024x1004.png?resize=578%2C567&ssl=1)
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](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/04-code-display-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Code, Saving tab](https://i1.wp.com/drdoane.com/wp-content/uploads/2019/05/05-code-saving-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Code, Completion tab](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/06-code-compelation-1024x1004.png?resize=578%2C567&ssl=1)
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](https://i1.wp.com/drdoane.com/wp-content/uploads/2019/05/07-code-diagnostics-1024x1004.png?resize=578%2C567&ssl=1)
Show me all the diagnostic information! I can take it.
![RStudio Tools, Global options, Appearance](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/08-appearance-1024x1006.png?resize=578%2C568&ssl=1)
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](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/09-pane-layout-1024x1004.png?resize=578%2C567&ssl=1)
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](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/10-packages-management-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Packages, Development tab](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/11-packages-development-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, R Markdown tab](https://i1.wp.com/drdoane.com/wp-content/uploads/2019/05/12-r-markdown-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Sweave tab](https://i1.wp.com/drdoane.com/wp-content/uploads/2019/05/13-sweave-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Spelling tab](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/14-spelling-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Git/SVN tab](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/15-git-svn-1024x1004.png?resize=578%2C567&ssl=1)
Yes, you should use version control. Take the dive and learn about it.
![RStudio Tools, Global options, Publishing tab](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/16-publishing-1024x1005.png?resize=578%2C567&ssl=1)
![RStudio Tools, Global options, Terminal tab](https://i2.wp.com/drdoane.com/wp-content/uploads/2019/05/17-terminal-1024x1004.png?resize=578%2C567&ssl=1)
![RStudio Tools, Keyboard Shortcuts Customizations - Mac](https://i0.wp.com/drdoane.com/wp-content/uploads/2019/05/18-keyboard-custom-shortcuts-1024x724.png?resize=578%2C409&ssl=1)
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.)
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.