Search code examples
rrstudioworking-directory

How can you set the working directory quickly to a file's location in RStudio?


The old method is the following :

enter image description here


Solution

  • There's a new feature on RStudio.
    Just right-click on the a script's tab and choose "Set Working Directory"

    enter image description here

    The script has to be saved first as an R file for this to work (see this comment)