rstudio different library path to command-line R (`$R_LIBS_USER`)

后端 未结 2 917
执念已碎
执念已碎 2021-02-08 05:36

I\'m trying to work out why my .libPath is different between command-line R and RStudio Desktop (NOTE: this is not a duplicate of

2条回答
  •  礼貌的吻别
    2021-02-08 06:27

    You write:

    Now I have set $R_LIBS_USER to ~/R/library in my bash profile,

    Do you by chance call RStudio from a gui icon, ie without invoking your ~/.bash_profile ? Maybe you can try calling a wrapper instead which sets it?

    For what it is worth, .libPaths() returns the same thing under RStudio Desktop and Server (though Server appends its internal directory), R on the command-line and via ESS for me.

    Edit: And in general, do read help(Startup) which will be time well-spent. The comment by @flodel is quite appropriate. If you get lost dealing with this consistently at the system level, you can always turn to R, either at its system-level (via Renviron and Renviron.site) or via the ~/R/ directory.

提交回复
热议问题