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.

Dan



On Thu, Nov 21, 2013 at 11:57 AM, Dirk Eddelbuettel <edd@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@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@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@r-project.org mailing list
> | https://stat.ethz.ch/mailman/listinfo/r-devel
>
> --
> Dirk Eddelbuettel | edd@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

	[[alternative HTML version deleted]]

