J Rstudio cheatsheet

If you use a tool a lot, like we do it in this course, you should learn a few useful keyboard shortcuts and tricks. Here is a list of the most important ones

J.1 Keyboard shortcuts

Note: some of these are system-dependent. See the complete list at Posit’s page, also available from menu Help -> Keyboard Shortcuts.

  • <-, the assignment operator: Alt - - (alt-minus).
  • %>%, the pipe operator: Ctrl + Shift + M
  • Open new script: Ctrl + Shift + N
  • zooming/focusing (see the View -> Panes menu:)
    • switch to source: Ctrl + 1
    • zoom to source: Ctrl + Shift + 1
    • switch to console: Ctrl + 2
    • zoom to console: Ctrl + Shift + 2
    • bring back the default 4-pane view: Ctrl + Shift + 0
  • Work with code
    • indent: Ctrl - I
    • comment/uncomment: Ctrl + Shift + C
  • run program (hover mouse over the buttons):
    • source with echo: Ctrl + Shift + Enter
    • source without echo: Ctrl + Shift + S
    • run selection/statement: Ctrl + Enter
    • save current file: Ctrl + S (asks for name if saving for the first time).
  • Rmarkdown
    • insert code chunk: Ctrl + Alt + I
    • knit: Ctrl - Shift - K

Resources

thematic::thematic_on(font = thematic::font_spec(scale=1.7))