I'm using GIT and I note that if I just move the whole folder (or rename it) in windows, that it breaks all the paths. I then end up in an infinite loop of trying to quit Rstudio and Rstudio unable to find the file path to save (or not save).
Is there a way to move the location of the project folder while keeping it still intact?
Sorry, let me make this clearer.
A default working directory is a folder where RStudio goes, every time you open it. You can change the default working directory from RStudio menu under: Tools –> Global options –> click on “Browse” to select the default working directory you want.
R is always pointed at a directory on your computer. You can find out which directory by running the getwd (get working directory) function; this function has no arguments. To change your working directory, use setwd and specify the path to the desired folder. dir – Specify a working directory.
Step 1) Click on the Session tab. Step 2) Click on Set Working Directory > To Source File Location. Afterwards, you working directory will be changed to the location of your source file.
With RStudio closed, I moved the project folder (using Windows Explorer) to a new location. My RStudio project opened fine from there. I made an edit and pushed it to Github.
If you use the here
package on Cran you won't have to update any links.
If you use GitHub Desktop, it will detect that the project has been moved and allow you to locate (set) it to a different folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With