I have the following in my .bashrc
export R_LIBS_USER="/home/wdkrnls/R/lib/3.2"
When I start R
from the shell I see (even in Emacs M-x shell
):
.libPaths()
[1] "/home/wdkrnls/R/lib/3.2" "/usr/lib/R/library"
When I start an R
process with M-x R
, I see:
.libPaths()
[1] "/usr/lib/R/library"
How do I make ESS
know about and use official R environment variables instead of ignoring them?
(setenv "R_LIBS_USER" "/home/wdkrnls/R/lib/3.2")
to your Emacs init file. In general, this is related to how environment variables are inherited by programs. Most likely you are running Emacs from shell that does not read that.bashrc
. There are also Emacs packages that parse environment variables from shell started from current user account and add them to Emacs environment, but I cannot remember the name at the moment.