I have two virtual machines running two different versions of GNU/Linux and accessing the same R executable from the same user account.
I'd like to use different libraries depending on the operating system. Right now I'm (un)commenting an R_LIBS=
environment variable each time I switch systems. Is there a better way to do this?
I tried placing if-then logic in bash syntax based on uname -n
, but got the following warning:
File /home/wdkrnls/.Renviron contains invalid line(s)
then
else
fi
They were ignored
I take it this file doesn't support programming constructs.
Something like this?
machine_name <- Sys.info()['nodename']
if (machine_name == 'myMachine1') {
.libPaths(...)
} else {
.libPaths(...)
}
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.