Comment out multiple lines in R or uncomment

Here is how to comment out multiple lines in R by using the shortcut Ctrl + Shift + C or other techniques. In RStudio, you can comment and uncomment a block of code by using a shortcut or GUI. Commenting is very useful if you want to keep a peace code for later or experiment… Continue reading Comment out multiple lines in R or uncomment

How to find or set the working directory in R

Sometimes it is necessary to find or set a working directory in R, even if you don’t necessarily want to. For example, if you are saving an R plot and do not understand where the result goes, it is necessary to look for that. You can do working directory detection or setup using the base… Continue reading How to find or set the working directory in R

Get full path to current R script

Are you wondering where is my current R script file located and how to determine the full path? Here is how to do that in RStudio or while running in batch mode.

How to restore closed unsaved script in RStudio

If you just recently closed the unsaved (untitled) source tab in RStudio, there is a good chance that you can get it back. Try to restore unsaved RStudio script in 3 different ways.

Exit mobile version