简体   繁体   中英

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. The docker image is Debian 10, R is installed in the image under the standard path /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 . If I open a shell into my container and start R, R.home() returns /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? Any ideas what I could try to fix this?

You most likely invoke R the wrong way. Use /usr/bin/R which is a frontend which sets R_HOME for further use by the other components.

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:~$ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM