short cut comment lines rstudio code example Example: How to add a comment in r Using R Studio, you can do Control+Shift+C, or Command+Shift+C on macOS.