1

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?

  • 2
    You'd also need to add (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. – wvxvw Jan 3 '16 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.