您可以打印/回显来自 .Renviron 的消息吗?
是否可以从 .Renviron 打印消息,以便在启动时在 RStudio 中显示它?
例如:
R_LIBS_USER="C:/Rlib/"
APIKEY="blabla"
echo Company envvar set
我不想使用 .Rprofile,因为它在项目中被覆盖。
编辑:
这是在 Windows 上本地安装的 R 上。我们以软件包的形式向某个 AD 组的所有成员推出 R/Rstudio/Rtools。正是在这个过程中我想做一些配置和信息。
It is possible to print messages from .Renviron so it is shown in RStudio at startup?
For example:
R_LIBS_USER="C:/Rlib/"
APIKEY="blabla"
echo Company envvar set
I don't want to use .Rprofile as that is overwriten in projects.
EDIT:
This is on locally installed R on windows. We roll out R/Rstudio/Rtools in a software package to all members of a certain AD group. It is in this process that I would like to do some configurations and information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如上所述,您可以在 R/R-4.xx/etc/Renviron.site 中设置环境变量,以便为所有用户设置这些变量,即使涉及项目:
然后设置 R/R -4.xx/etc/Rprofile.site 打印这些变量:
然后启动一个新会话,在项目内部外部将设置所有变量并打印所有消息:
As noted above you could set environment variables in
R/R-4.x.x/etc/Renviron.site
to set these for all users, even when projects are involved:Then set
R/R-4.x.x/etc/Rprofile.site
to print these variables:Then starting a new session, inside outside of a project will set all variables and print all messages: