Skip to content

Commit

Permalink
Add note about commenting multiple existing lines
Browse files Browse the repository at this point in the history
Co-authored-by: Ammar Alkhaldi <[email protected]>
  • Loading branch information
Bisaloo and Ammar-K committed Jan 29, 2024
1 parent aa2f256 commit d46d9bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion episodes/09-supp-intro-rstudio.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ window and press <kbd>Esc</kbd>; this should help you out of trouble.
## Commenting

Use `#` signs to comment. Comment liberally in your R scripts. Anything to the
right of a `#` is ignored by R. Comments remind yourself of what certain functions you write do, and it helps others understand their purpose without having to read the code. Start your comments with a `#` signs, which R takes as the sign to ignore anything to the right of it when running the code. Also remember that expressive naming of functions, arguments and variables, as well as [`#'`\-prefixed roxygen documentation](08-making-packages-R.Rmd), document your code. Consider free-form, #-comments as a last resort.
right of a `#` is ignored by R. Comments remind yourself of what certain functions you write do, and it helps others understand their purpose without having to read the code. Start your comments with a `#` signs, which R takes as the sign to ignore anything to the right of it when running the code.
To comment multiple lines in RStudio, you can select the lines you want to comment and use <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>C</kbd> to comment/uncomment.

Also remember that expressive naming of functions, arguments and variables, as well as [`#'`\-prefixed roxygen documentation](08-making-packages-R.Rmd), document your code. Consider free-form, #-comments as a last resort.


## Assignment Operator

Expand Down

0 comments on commit d46d9bb

Please sign in to comment.