Skip to content

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

2 messages · Dirk Eddelbuettel, Sébastien Bihorel

#
On 9 May 2010 at 16:33, Sebastian P. Luque wrote:
| Hi Dirk,
| 
| On Sun, 9 May 2010 16:04:52 -0500,
| Dirk Eddelbuettel <edd at debian.org> wrote:
| 
| [...]
| 
| > /etc/R/ -- and see help(Startup) for the files.  All also explained in
| > the R Inst. and Admin manual.
| 
| > If you don't have the softlinks from /etc/R/ then it is
| 
| >    $whereEver/R/etc/
| 
| > instead.
| 
| Thanks, I'm familiar with these, but I was referring to the local
| R-devel so was hoping for something that didn't involve modifying these
| files because they'd get wiped out every time R-devel is rebuilt.
| Perhaps there's just no way around that.

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 :)
#
On Sun, 9 May 2010 16:50:17 -0500,
Dirk Eddelbuettel <edd at debian.org> wrote:

            
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--------------------->---