[英]Hot to set R home directory in r.net on docker/Debian?
I try to use R.Net in an asp.net Razor App with docker support.我尝试在 asp.net Razor 应用程序中使用 R.Net 和 Z05B6053C41A2130AFD6FCDAB 支持。 The docker image is Debian 10, R is installed in the image under the standard path /usr/lib/R
. docker 镜像是 Debian 10,R 安装在镜像中的标准路径/usr/lib/R
下。 When executing执行时
REngine.SetEnvironmentVariables(rHome:"/usr/lib/R"); // or any other path including none
REngine engine = REngine.GetInstance();
I obtain the error R home directory is not defined
.我收到错误R home directory is not defined
。 If I open a shell into my container and start R, R.home()
returns /usr/lib/R
.如果我在容器中打开 shell 并启动 R, R.home()
将返回/usr/lib/R
。 So it looks as if R in the container has a R home directory set, but r.net isn't recognizing it?所以看起来容器中的 R 有一个 R 主目录集,但 r.net 没有识别它? Any ideas what I could try to fix this?有什么想法我可以尝试解决这个问题吗?
You most likely invoke R the wrong way.您很可能以错误的方式调用 R。 Use /usr/bin/R
which is a frontend which sets R_HOME
for further use by the other components.使用/usr/bin/R
这是一个前端,它设置R_HOME
以供其他组件进一步使用。
edd@rob:~$ file /usr/bin/R
/usr/bin/R: Bourne-Again shell script, ASCII text executable
edd@rob:~$ grep ^R_HOME /usr/bin/R
R_HOME_DIR=/usr/lib/R
R_HOME="${R_HOME_DIR}"
edd@rob:~$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.