[R-sig-Debian] running a locally built R-devel with libraries from Debian installation

Sebastian P. Luque spluque at gmail.com
Mon May 10 00:39:22 CEST 2010


On Sun, 9 May 2010 16:50:17 -0500,
Dirk Eddelbuettel <edd at debian.org> wrote:

> There are still a number of possibilities in the R Inst + Admin
> manual; a simple one would be to set the env. var R_LIBS via
> /etc/environment.

> But you need to tell us what you can or cannot do or want to do.  The
> 'No Psychics here' rule applies for you too :)

I don't know what else to add to what I've already said, but here's a
scenario to illustrate.  Suppose you have R-devel in ~/src/R-devel and
then you call ~/src/R-devel/bin/R and do library(RPostgreSQL).
RPostgreSQL requires DBI, and you have RPostgreSQL in
/usr/local/lib/R/site-library and DBI in /usr/lib/R/site-library because
you installed the former via install.packages() and the latter via
r-cran-dbi, both of which you use normally with Debian R packages.  If
you wanted this to work then both libraries should be in the return
value of .libPaths(), which is not the case with a locally-built R-devel
like the one I described.

Anything you modify in ~/src/R-devel (I think that's what you're
suggesting) will be wiped out the next time you update and rebuild it,
so it's not convenient.  So it seems the only options are ~/.Rprofile
and ~/.Renviron and am not sure what to use in these so that if R-devel
is started then R_LIBS or R_LIBS_SITE or R_LIBS_USER include both of
these libraries *in addition* to the default ones defined by R-devel.
Nothing needs changing if Debian R is started.

As it is, R-devel shows:

---<--------------------cut here---------------start------------------->---
R> Sys.getenv("R_LIBS")
R_LIBS 
    "" 
R> Sys.getenv("R_LIBS_SITE")
R_LIBS_SITE 
         "" 
R> Sys.getenv("R_LIBS_USER")
                                R_LIBS_USER 
"~/R/x86_64-unknown-linux-gnu-library/2.12" 
---<--------------------cut here---------------end--------------------->---

while Debian R:

---<--------------------cut here---------------start------------------->---
R> Sys.getenv("R_LIBS")
R_LIBS 
    "" 
R> Sys.getenv("R_LIBS_SITE")
                                                               R_LIBS_SITE 
"/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library" 
R> Sys.getenv("R_LIBS_USER")
                           R_LIBS_USER 
"~/R/x86_64-pc-linux-gnu-library/2.11" 
---<--------------------cut here---------------end--------------------->---


-- 
Seb



More information about the R-SIG-Debian mailing list