From Achim.Zeileis at wu-wien.ac.at  Tue Sep 20 16:14:09 2005
From: Achim.Zeileis at wu-wien.ac.at (Achim Zeileis)
Date: Tue, 20 Sep 2005 16:14:09 +0200 (CEST)
Subject: [Rd] Shy Suggestion?
In-Reply-To: <1127224092.21824.20.camel@biol102145.oulu.fi>
References: <1127222728.21824.15.camel@biol102145.oulu.fi>
	<433011BE.8090007@jhsph.edu>
	<1127224092.21824.20.camel@biol102145.oulu.fi>
Message-ID: <Pine.LNX.4.58.0509201608150.13157@thorin.ci.tuwien.ac.at>

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
>



[Rd] Shy Suggestion?
Achim Zeileis