Working in RStudio

Jeff Stevens

2025-01-24

Review Mental model of R

Tour of RStudio

Mental model of RStudio

Keyboard shortcuts

Here are some of my favorite things!

Tools > Keyboard Shortcuts Help or Alt/Opt+Shift+K

Function Keyboard shortcut
Run current line Ctrl/Cmd+Enter/Return
Source entire script Ctrl/Cmd+Shift+S
Insert assignment operator Alt/Opt+-
Insert pipe Ctrl/Cmd+Shift+M
Comment lines Ctrl/Cmd+Shift+C

Options

  • Turn off restore workspace
  • Turn off save history
  • Turn on soft wrap
  • Turn on rainbow parentheses
  • Use native pipe operator
  • Change your theme

Installing packages

Getting help

Online forums

Online portals

Tips

  • Learn to use keyboard shortcuts (not just RStudio shortcuts, but general ones)

  • You can remap RStudio keyboard shortcuts (I’ve remapped Insert assignment operator to Ctrl/Cmd+Shift+,)

  • Your cursor can be anywhere in your code to useCtrl/Cmd+Enter to run it

  • Use autocomplete

  • Copy/paste to avoid misspelling

  • Restart R often

What about Positron?

Let’s explore!

Working in RStudio