Useful rstudio shortcuts

  • Scripting (replace Cmd by Ctrl for PC)
    • Cmd + -: insert <-
    • Cmd + Shift + M: insert %>%
    • Cmd + Alt + I: insert code chunk
    • Alt + or : move line up / down
    • Cmd + Alt + or : copy line up / down
    • Ctrl + Alt + or : multi-line edition
  • # analysis step #### for navigating in your then tagged code
  • Running
    • Cmd + Enter: run code
    • Cmd + Shift + P: re-run Previous code
    • Cmd + Shift + Enter: run Current chunk
    • Cmd + Shift + K: Knit document

See the Rstudio blog, with GIFs