[Rd] Shy Suggestion?

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Tue Sep 20 16:14:09 CEST 2005


On Tue, 20 Sep 2005, Jari Oksanen wrote:

> On Tue, 2005-09-20 at 09:42 -0400, Roger D. Peng wrote:
> > I think this needs to fail because packages listed in 'Suggests:' may, for
> > example, be needed in the examples.  How can 'R CMD check' run the examples and
> > verify that they are executable if those packages are not available?  I suppose
> > you could put the examples in a \dontrun{}.
> >
> Yes, that's what I do, and exactly for that reason: if something is not
> necessarily needed (= 'suggestion' in this culture), it should not be
> required in tests. However, if I don't use \dontrun{} for a
> non-recommended package, the check would fail and I would get the needed
> information: so why should the check fail already when checking
> DESCRIPTION?

My understanding is that `suggests' only gives suggestions for the user
not the developer. This means that if you as the developer run R CMD check
you need to have the suggested packages available (in order to check all
code in the examples/vignettes/etc.) but the user does not have to have
them for installing/attaching the package.

For example, in my packages if frequently have examples of type

  if(require(foo)) {
    x <- foo(...)
    bar(x)
  }

where foo is a suggested package. This code would never be R CMD checked
if I just don't install the package myself.

Best,
Z

> cheers, jari oksanen
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list