Re: [R]package dependence

About this list Date view Thread view Subject view Author view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Thu 15 Feb 2001 - 19:02:13 EST


Message-ID: <Pine.GSO.4.31.0102150854470.13152-100000@toucan.stats>

On Thu, 15 Feb 2001, Christian Hoffmann wrote:

> Hi,
>
> I want to create several packages, with package Aa depending on functions
> in package A. My directories with .r and .Rd are organized as follows
>
> ./A/man/*.Rd
> ./A/R/*.r
> ./Aa/man/*.Rd
> ./Aa/R/*.r
>
> Afre creatin package A with
>
> R CMD check A
> R CMD INSTALL --library=lib A
>
> I then have
> ./lib/A/help etc
>
> If I try to do
>
> R CMD check Aa
> R CMD INSTALL --library=lib Aa
>
> I am getting
>
> * checking examples ... ERROR
> and in ./Aa.Rcheck/Aa-Ex.Rout
>
> there is the error signalled
>
> couldn't find function "function.from.A"
> Execution halted
>
> Since I rather want to keep the packages separate, how can I deal with
> dependences among packages?

Does the function .First.lib in package Aa contain `require(A)'? That is
how this is done. (You can also put it in any of the code files of
package Aa, but it seems cleaner to use .First.lib.)

To use this with R CMD check you need to ensure that `lib' is used as a
library directory. As R CMD check uses --vanilla, you will need to set
R_LIBS=lib, in the calling environment as .Rprofile and .Renviron are
skipped.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2b30 : Fri 22 Jun 2001 - 18:58:33 EST