Getting .Rprofile to Load at Startup

拟墨画扇 提交于 2019-12-01 15:36:10

The R docs should help to see how to deal with .Rprofiles. Execute the following at the console:

> ?Startup

The relevant portion of this indicates that you need to put your project .Rprofile in the initial working directory that will be loaded when starting the project. Thus if your project is ~/foo/foobar.Rproj, then you should have your profile be ~/foo/.Rprofile and make sure that when starting up, the initial working directory is ~/foo/. You can see this in the title bar at the top of the console pane in RStudio.

Also to confirm that the correct .Rprofile is actually being loaded, I would personally put in a test to see which (if any) profile is being picked up. For example, include:

print("This is the Rprofile inside the foo project!")

Here is another example about getting this to work:

http://support.rstudio.org/help/discussions/suggestions/1095-different-rprofile-for-a-project#comment_15690293

Finally, if the correct .Rprofile is being loaded inside the project, then there must be something wrong with your code. Looks like you got this from our docs though, so if you get the profile loaded, and continue to have problems, please let us know. You can post a new discussion on our support thread.

Josh

Product Manager - RStudio

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