[R-sig-Debian] Debian Testing: ~/.Renviron seems to not being read (R_LIBS not set)

Marius Hofert marius.hofert at uwaterloo.ca
Mon Mar 30 18:30:37 CEST 2015


Dear Johannes, Dear Dirk,

Thanks a lot for helping. Here is the missing information.

Here is how I installed R. This is basically how Martin Maechler
showed me to install R under Ubuntu (in several versions so that they
are also recognized by ESS). My goal is to adjust this to make it work
for Debian:

1) sudo emacs /etc/apt/sources.list # then add:
   deb http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3/
   deb-src http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3/

2) sudo apt-get build-dep r-base

3) sudo mkdir /usr/local/R
   sudo chown mhofert:mhofert /usr/local/R

   cd /usr/local/R
   wget http://cran.r-project.org/src/base/R-3/R-3.1.3.tar.gz
   tar -xzf R-3.1.3.tar.gz
   mv R-3.1.3 R-3.1.3-source

   mkdir R-3.1.3-build
   cd R-3.1.3-build
   ../R-3.1.3-source/configure

   make
   make check
   make pdf
   make info

   cd ..
   ln -s /usr/local/R/R-3.1.3-build/bin/R /usr/local/R/R

   sudo emacs ~/etc/bash.bashrc # then add:
   PATH=/usr/local/R:$PATH


.libPaths() shows:

> .libPaths()
[1] "/usr/local/R/R-3.1.3-build/library"


and sessionInfo() is:

> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


Interestingly, under Ubuntu, I find /etc/R/Renviron, under Debian, it
does not exist... hmmm... what's flawed in the above installation
process (?)

Cheers,
Marius


On Mon, Mar 30, 2015 at 7:39 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Hi Marius,
>
> On 30 March 2015 at 02:24, Marius Hofert wrote:
> | I have Debian Testing running on a Lenovo Thinkpad X1
> | Carbon (2015, 3rd gen.). I would like to have a package library
> | independent of the installed R version. Under Ubuntu, I used to
> | have the following line in ~/.Renviron:
> | R_LIBS=/usr/local/R/library:/usr/lib/R/site-library This worked
> | fine and /usr/local/R/library showed up in .libPaths().
>
> Please look at
>
>        /etc/R/Renviron
>        /usr/lib/R/etc/Renviron
>
> (which are the same file via softlinks) and how they set R_LIBS_SITE and have
> been 2003 (!!).
>
> | However, under Debian (with the same ~/.Renviron), my .libPaths()
> | just shows "/usr/local/R/R-3.1.3-build/library" which is the
> | version-dependent library (this used to come at 3rd position in
> | .libPaths()). Does R on Debian not look for ~/.Renviron? I also
>
> It should. See help(Startup).
>
> And does:
>
>   edd at max:~$ grep Hello .Renviron
>   MARIUS="Hello, world from .Renviron"
>   edd at max:~$ R -q -e 'Sys.getenv("MARIUS")'
>   R> Sys.getenv("MARIUS")
>   [1] "Hello, world from .Renviron"
>   R>
>   R>
>   edd at max:~$
>
> Small caveat: littler does not (yet). But you didn't say whether you used R
> or r.
>
> Dirk
>
> | tried R_LIBS_USER but no luck here either (although, as far as I
> | understand Section 6.2 of "R Installation and Administration",
> | R_LIBS or R_LIBS_USER should work (?))
> |
> | Cheers, Marius
> |
> | PS: I found two sites which seem to be related, but it was still
> | not quite clear to me how to approach the problem:
> | https://stat.ethz.ch/pipermail/r-sig-debian/2005-December/000050.html
> | https://stat.ethz.ch/pipermail/r-sig-debian/2010-May/001146.html
> |
> | _______________________________________________
> | R-SIG-Debian mailing list
> | R-SIG-Debian at r-project.org
> | https://stat.ethz.ch/mailman/listinfo/r-sig-debian
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-SIG-Debian mailing list