From mtmorgan at fhcrc.org  Fri Apr 29 16:50:57 2011
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Fri, 29 Apr 2011 07:50:57 -0700
Subject: [Rd] R CMD check and Suggests Packages
In-Reply-To: <55AB7D33-3717-44EC-82E2-AF0D2C45B977@r-project.org>
References: <20110429120016.BLP71069@gimr.garvan.unsw.edu.au>	<alpine.LFD.2.02.1104291026210.21146@gannet.stats.ox.ac.uk>	<BANLkTin=OmX99AF=0eRTonUeF7PB9cnrtg@mail.gmail.com>
	<55AB7D33-3717-44EC-82E2-AF0D2C45B977@r-project.org>
Message-ID: <4DBAD051.9080902@fhcrc.org>

On 04/29/2011 07:36 AM, Simon Urbanek wrote:
>
> On Apr 29, 2011, at 9:52 AM, Steve Lianoglou wrote:
>
>> Hi,
>>
>> On Fri, Apr 29, 2011 at 5:29 AM, Prof Brian Ripley
>> <ripley at stats.ox.ac.uk>  wrote:
>>> On Fri, 29 Apr 2011, Dario Strbenac wrote:
>>>
>>>> Hello,
>>>>
>>>> In my description file, I have an example data package in Suggests: that
>>>> I've deleted from my library to test what the user who doesn't have it will
>>>> experience.
>>>>
>>>> However, R CMD check won't even pass my package :
>>>>
>>>> * checking package dependencies ... ERROR
>>>> Package required but not available: RepitoolsExamples
>>>>
>>>> Why would it have to be installed, if it's only a data package, that isn't
>>>> needed in any of my code ? The manual also says "In particular, large
>>>> packages providing ?only? data for examples or vignettes should be listed in
>>>> ?Suggests? rather than ?Depends? in order to make lean installations
>>>> possible."
>>>
>>> Why suggest a package that 'isn't needed in any of my code'?
>>>
>>> I suspect that is a lie, and some of your code does use it: if some it is
>>> needed to fully check the package.   There is a option to 'R CMD check' to
>>> enable the check to go ahead without all the dependencies, so please do
>>> re-read the manuals to find it.
>>
>> Here's a stab in the dark:
>>
>> Perhaps the OP has code in some \examples{} section for some help
>> (*.Rd) file that then tries to load data from the "suggested" package?
>>
>
> But that is a valid use of Suggests: as long as it is guarded against that package not being present.
>
> The point here is that the default is to check those packages yet Dario doesn't like it and thus should turn it off if he feels so inclined. (That's my interpretation without knowing the package).
>
> Cheers,
> Simon
>
>
>
>> The code in the \examples{} sections of *.Rd files are run during R
>> CMD check ... so, if you're trying to load data from a suggested
>> package that may not be installed, perhaps you can wrap those code
>> blocks with \dontrun{}.
>>
>
> Not really - that defeats the purpose - it will never be checked int hat case!

Maybe also useful to distinguish between package check and INSTALL, 
where during the former the Suggests: package must be present (modulo 
setting additional flags) but in the latter may not be. The Bioconductor 
build system, for instance, would install RepitoolsExamples  before 
running R CMD check Repitools. A user might successfully install 
Repitools without installing RepitoolsExamples.

"if (require(RepitoolsExamples))" in an example on a man page is much 
preferred to \dontrun{}, as Simon mentions.

Martin Morgan


>
>
>> For more info: this is covered in the "Writing R Extensions," but is
>> also described here:
>> http://stackoverflow.com/questions/1454211/what-does-not-run-mean-in-r-help-pages
>>
>> HTH,
>> -steve
>>
>> --
>> Steve Lianoglou
>> Graduate Student: Computational Systems Biology
>>   | Memorial Sloan-Kettering Cancer Center
>>   | Weill Medical College of Cornell University
>> Contact Info: http://cbio.mskcc.org/~lianos/contact
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



[Rd] R CMD check and Suggests Packages
Martin Morgan