Most used Rstudio and R keyboard shortcuts

  1. General Shortcuts
    • Ctrl+Enter: Run the current line or selection.
    • Ctrl+Shift+Enter: Run the current line or selection in the console and move to the next line.
    • Ctrl+Shift+F10: Run the current line or selection and keep the cursor in the same place.
    • Ctrl+Shift+C: Comment/uncomment the current line or selection.
    • Ctrl+Shift+D: Duplicate the current line or selection.
    • Ctrl+Shift+M: Insert a new Markdown chunk.
    • Ctrl+Shift+K: Knit the current R Markdown document.
    • Ctrl+Shift+O: Organize the code.
    • Ctrl+F10: Stop the current computation.
  2. Navigation and Editing
    • Ctrl+1: Switch to the source editor.
    • Ctrl+2: Switch to the console.
    • Ctrl+Shift+F: Find in files.
    • Ctrl+D: Delete the current line.
    • Ctrl+L: Clear the console.
    • Ctrl+Shift+Z: Redo.
    • Ctrl+Shift+F12: Toggle the focus between the source editor and console.
  3. Document and Workspace
    • Ctrl+S: Save the current document.
    • Ctrl+W: Close the current tab.
    • Ctrl+Shift+W: Close all tabs.
    • Ctrl+Shift+N: Create a new document.
    • Ctrl+Shift+P: Open the package documentation.
    • Ctrl+Alt+W: Close all panes.
  4. R Markdown
    • Ctrl+Alt+I: Insert a chunk.
    • Ctrl+Alt+T: Insert an inline code chunk.
    • Ctrl+Alt+B: Insert a bold text chunk.
    • Ctrl+Alt+I: Insert an italicized text chunk.
    • Ctrl+Alt+O: Insert an ordered list chunk.
    • Ctrl+Alt+U: Insert an unordered list chunk.

These are just a few of the many keyboard shortcuts available in RStudio. You can explore more shortcuts and customize them by going to "Tools" > "Modify Keyboard Shortcuts" in the RStudio menu.