How to set back RStudio to global default working directory?

人走茶凉 提交于 2020-12-15 05:38:32

问题


In the General R Options of RStudio, in the option Default working directory (when not in a project):, previous to set for the first time a specific directory appears this symbol ~ that means No directory or Global default working directory, like here:

My problem is that I set the directory to My documents folder, and I can't set it back to ~ because the Browsebutton doesn't allow it. Do you know how can I set it back to ~?

I would like to do that because in my new scripts I'm changing always this directory to other paths with the setwd() function. But when I close RStudio all the objects from my workspace are saved in this new directory set with setwd(), then I have to save manually every time my workspace to My documents directory. Therefore, I prefer to change it to Global default working directory ~, and I can't find how to do this.

Thanks in advance


回答1:


For PC, go to your RStudio user-settings file location (Note you may have to show hidden folders in your folder options settings):

C:\Users[your name]\AppData\Local\RStudio-Desktop\monitored\user-settings

Edit your RStudio with Notepad, change or delete the directory.

Here is what you probably have: initialWorkingDirectory="C:/Users/[your name]/Documents"

Change to: initialWorkingDirectory="~"

Hope that helps.



来源:https://stackoverflow.com/questions/31594993/how-to-set-back-rstudio-to-global-default-working-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!