From edd at debian.org  Thu Nov 21 17:57:08 2013
From: edd at debian.org (Dirk Eddelbuettel)
Date: Thu, 21 Nov 2013 10:57:08 -0600
Subject: [Rd] R CMD check (v-3.0.2) not loading $R_CHECK_ENVIRON
In-Reply-To: <CAGJuTd-DdG8Qi-d0T-FsuKu=c93p=mELvFMXQF4-pzCU53EuSw@mail.gmail.com>
References: <CAGJuTd-DdG8Qi-d0T-FsuKu=c93p=mELvFMXQF4-pzCU53EuSw@mail.gmail.com>
Message-ID: <21134.15204.190737.936995@max.nulle.part>


On 21 November 2013 at 11:23, Daniel Polhamus wrote:
| Hi all,
| 
| I'm trying to check a package using R CMD check --as-cran <package>.  When
| I do so, the check fails upon not finding the dependencies which I have
| installed in a non-standard location.  Per the manual, I created
| ~/.R/check.Renviron :

Who is '~' here?  You, or root?

| $ cat ~/.R/check.Renviron
| R_LIBS=/usr/lib64/R/library:/usr/lib64/R/var
| R_LIBS_SITE=/usr/lib64/R/library:/usr/lib64/R/var

/usr/lib64/R/var ?  Really?   You mix system directories with user-controlled
ones?  Interesting surprises may come your way...

| No luck.  I tried explicitly pointing R_CHECK_ENVIRON to
| ~/.R/check.Renviron:
| 
| $ echo $R_CHECK_ENVIRON
| /root/.R/check.Renviron
| 
| Still no luck.  Finally, I just set R_LIBS globally (which, was empty)
| before running the check and the dependencies are then found.  Just wanted
| to be sure I'm not missing something before creating a bug report.
| 
| This is on Ubuntu 10.04 with R-3.0.2, as root.

Never ever run R as root.  

If you want to write to /usr/local/lib/R/site-library (as you may want to and
should), either change the permissions, or better still add yourself and
colleagues to the group owning the directory and/or make the directory
group-owned by a group on the system (our choice at work). R 3.0.2 now
reflects these permission so you can all write there jointly.

That said, this all works here, but I run R as me and never ever as root:

   edd at max:~$ tail -4 .R/check.Renviron
   # edd Apr 2003  Allow local install in /usr/local, also add a directory for
   #               Debian packaged CRAN packages, and finally the default dir 
   # edd Jul 2007  Now use R_LIBS_SITE, not R_LIBS
   R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}
   edd at max:~$ 

The question would have been quite appropriate for r-sig-debian (which also
acts as "r-sig-ubuntu").

Lastly: Ubuntu 10.04. Really?  I find 12.04 too old.  

Dirk

 
| Many thanks...
| 
| -- 
| Daniel G Polhamus, PhD
| Metrum Research Group, LLC
| 
| 	[[alternative HTML version deleted]]
| 
| ______________________________________________
| R-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



[Rd] R CMD check (v-3.0.2) not loading $R_CHECK_ENVIRON
Dirk Eddelbuettel