1

When I click on "File/Open Project..." RStudio opens my home directory at "~", but I would like to open the directory at "~/Documents/coding/" where I store all my Rprojects. How can I change the default directory that RStudio opens when it opens projects?

I have tried adding the global variable

HOME='~/Documents/coding'

to my .Rprofile and Renviron files but this has not changed the default directory opened even after I have restarted RStudio.

Joe
  • 3,217
  • 3
  • 21
  • 37
  • In Rstudio, under the Tools Menu > Global Options > General. From this window one can set the default working directory. – Dave2e Dec 18 '19 at 19:55
  • @Dave2e Changing the default working directory will not change the directory that RStudio opens when you click on "File/Open Project...". My default working directory is set to "~/Documents/coding" but RStudio still opens "~" when I open a project. – Joe Dec 18 '19 at 20:02

2 Answers2

0

I know this is old, but I was able to follow the directions at https://support.microsoft.com/en-us/topic/configuration-of-the-my-documents-folder-dfd9a90d-8f80-18d6-e7cc-f1566fc3b10b to get it to work. The gist is that the default documents on Windows 10 is stored in the registry. I changed it at the registry level and File:Open Project in RStudio defaulted to the changed folder in the registry.

jhollist
  • 143
  • 9
0

I checked and the only way is to change the value in the register of windows

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

And change the value of personal to the path of your r project

'D:/R_project'
cloudscomputes
  • 1,278
  • 13
  • 19