B Short-cuts and Cheat Sheets
B.1 Keyboard Short-cuts
There are lots of quick keyboard short-cuts that will make you more efficient in programming. Here are some that I use a lot.
Stroke | Function |
---|---|
alt + up /down |
Move entire line or highlighted block up or down in RStudio |
alt + left /right |
Move cursor one word to the left or right. |
ctrl + up /down |
Move cursor to the beginning or end of the document. |
ctrl + left /right |
Move cursor to the beginning or end of the line. |
For all the above, hold down shift
to simultaneously highlight word-by-word (alt
) or from the cursor to the end/beginning of the line or document (ctrl
). Then you can use alt
+ up
/down
to move chunks of code around your script or just press del
to delete it.
Stroke | Function |
---|---|
shift + ctrl + n |
Open a new document |
tab |
Attempt auto-complete |
ctrl + enter |
Execute command from the editor |
alt + - |
Insert <- |
shift + ctrl + m |
Insert %>% |
shift + ctrl + c |
Comment/uncomment line |
ctrl + z |
Undo |
shift + ctrl + z |
Redo |
ctrl + a |
Select all |
ctrl + d |
Delete line |
alt + cmd + i |
Insert chunk in R markdown |
B.2 Cheat Sheets
From RStudio:
- purrr package
- Import data
- dplyr package
- R Markdown = R Markdown reference guide
- RStudio IDE
- ggplot2 package
- LaTeX
- Regular Expressions
From DataCamp