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


On 21 November 2013 at 13:34, Daniel Polhamus wrote:
| Dirk,
| Thanks for the advice on general usage. ?For context, these builds occur on
| Amazon AMI's with ephemeral instances, R is never updated by users (hence the
| careless placement of a user controlled library in a system library). ?
| ??
| You indicate that R CMD check should behave as specified in the manual if
| running as me, not root. ?This didn't solve the problem, it still fails to
| load the R_SITE_LIBS from the check.Renviron file. ? Furthermore, I just
| tested this on my local machine (OS/X 10.9, again with R-3.0.2) and I'm seeing
| identical behavior. ?
| 
| The check passes without a problem after setting R_LIBS (perhaps not necessary)
| and R_SITE_LIBS globally ($ export R_SITE_LIBS=<path>).
| 
| I suspect that if I install dependencies into /usr/local/lib/R/site-library (or
| any place in the default .libPaths) as you suggest, the check will pass -- but
| I am installing OFF the default path for a good reason.

If R comes from the package(s) we provide, try editing / sed'ing
/etc/R/Renviron.site directly.  That may work better than the per-user
settings.

The help(Startup) page is very long and detailed but should eventually help
you to get there.  

Note though that these things do change over time, so you may want to glance
at the NEWS file as well. I only started to use ~/.R/check.Renviron within
the last few years.

Cheers, Dirk

| 
| Dan
| 
| 
| 
| On Thu, Nov 21, 2013 at 11:57 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
| 
| 
|     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
| 
| 
| 
| 
| --
| Daniel G Polhamus, PhD
| Metrum Research Group, LLC
| 2 Tunxis Rd, Suite 112
| Tariffville, CT 06081
| (888) 308-7049 ext 403

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