

Comment or uncomment lines with Command + Shift + C on a Mac or Control + Shift + C on Linux and Windows.Restart the current R session and start fresh with Command + Shift + F10 on a Mac or Control + Shift + F10 on Linux and Windows.

Run all lines of code with Command + A + Enter on a Mac or Control + A + Enter on Linux and Windows.Run the current line of code with Command + Enter on a Mac or Control + Enter on Linux and Windows.Insert the % with Command + Shift + M on a Mac, or Ctrl + Shift + M on Linux and Windows.Here are some of our favorite RStudio shortcuts: RStudio provides dozens of useful shortcuts that you can access through the menu at the top: Tools > Keyboard Shortcuts Help.Īnother way to access RStudio keyboard shortcuts is with a shortcut! To access shortcuts, type Option + Shift + K on a Mac, or Alt + Shift + K on Linux and Windows. Knowing RStudio keyboard shortcuts will save lots of time when programming. (Side note: The + we show in the shortcuts means “and”, so there’s no need to actually type the + key.)īut what if you want to return to the standard four-pane view? No problem! Enter Control/Ctrl + Shift + 0: For example, enter Control/Ctrl + Shift + 1 to maximize the R script, notebook, or R Markdown file you are working in.

If you prefer to only have one pane in view at a time, add Shift to any of the above commands to maximize the pane.

