kgui
kgui

Reputation: 4165

.libPaths() not changing

I have set R_LIBS in my .bash_profile to

export R_LIBS=/lib/R-3.3.0

and when I echo $R_LIBS, it returns /lib/R-3.3.0 but, when I start R and type .libPaths() I get /Software/R.

What is going wrong?

Thanks

Upvotes: 0

Views: 641

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368231

You want R_LIBS_USER:

$ Rscript -e 'print(.libPaths())'
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"   
[3]            "/usr/lib/R/library"           
$ R_LIBS_USER="/tmp" Rscript -e 'print(.libPaths())'
[1]                    "/tmp"  "/usr/local/lib/R/site-library" 
[3] "/usr/lib/R/site-library"             "/usr/lib/R/library" 
$ 

We see that adding one value to R_LIBS_USER adds a fourth directory to the three I get by default on my system.

Upvotes: 3

Related Questions