An Introduction to R and RStudio

RStudio Keyboard Shortcuts

Below I have included a list of useful RStudio keyboard shortcuts for Windows/Linux (for a detailed list of keyboard shortcuts and Mac keys visit http://rstudio.org/docs/using/keyboard_shortcuts).

Console Clear console Ctrl+L Popup command history Ctrl+Up Yank line up to cursor Ctrl+U Yank line after cursor Ctrl+K Insert currently yanked text Ctrl+Y

Source New Document Ctrl+Shift+N Close active document Ctrl+Shift+L Run current line/selection Ctrl+Enter Run current document Ctrl+Shift+Enter Switch to tab Ctrl+Alt+Down Previous tab Ctrl+Alt+Left Next tab Ctrl+Alt+Right First tab Ctrl+Shift+Alt+Left Last tab Ctrl+Shift+Alt+Right Extract function from selection Ctrl+Alt+F Comment/uncomment Ctrl+Shift+C Delete Line Ctrl+D Move Lines Up/Down Alt+Up/Down Copy Lines Up/Down Ctrl+Alt+Up/Down Select Page Up/Down Shift+PageUp/PageDown Select to Start/End Shift+Alt+Up/Down

Completions (Console and Source) Attempt completion Tab or Ctrl+Space Navigate candidates Up/Down Accept selected candidate Enter, Tab, or Right Show help for selected candidate F1 Dismiss completion popup Esc

Views Move cursor to source Ctrl+1 Move cursor to console Ctrl+2 Show workspace Ctrl+3 Show data Ctrl+4 Show history Ctrl+5 Show files Ctrl+6 Show plots Ctrl+7 Show packages Ctrl+8 Show help Ctrl+9

Plots Previous plot Ctrl+PageUp Next plot Ctrl+PageDown *Note: newer releases of RStudio have resulted in a few of these shortcuts being depreciated.