Re: [Rd] Enhances, require() and quality control

From: Gregor Gorjanc <>
Date: Tue 12 Dec 2006 - 08:19:41 GMT

Kurt Hornik wrote:

>>>>>> Gregor Gorjanc writes:

>> Hello!

>> I am working on a package where Enhances field seems to be a plausible
>> option. When I add package, say coda, to this field, I get the
>> following warning with recent R-devel:

>> ----

>> * checking for working latex ... OK
>> * using log directory '/home/ggorjan/programs/R/devel/test.Rcheck'
>> * using R version 2.5.0 Under development (unstable) (2006-12-06 r40129)
>> * checking for file 'test/DESCRIPTION' ... OK
>> * this is package 'test' version '0.1'
>> * checking package dependencies ... WARNING
>> 'library' or 'require' calls not declared from:
>>   coda

>> See the information on DESCRIPTION files in the chapter 'Creating R
>> packages' of the 'Writing R Extensions' manual.

> Why would you think that Enhances: is right here?
> If you use library or require on a package, you do more than enhance it,
> and the package should be listed in Depends or Suggests.

I might have understood Enhances field wrongly but imagine this situation. I have a package A and if I can use package B I would like to use it otherwise try with "my own" solution. I thought that Enhances fields is exactly for such situation. How should I check if package B is available? I used

if(require(B)) {
} else {


But R CMD check complains.

I have encountered this with R2WinBUGS. This package helps calling WinBUGS from R. It can also use OpenBUGS via BRugs, but BRugs is available only for Windows. Therefore, one can not do any QC under Linux. I thought to provide ability to call OpenBUGS via the same way WinBUGS is called and then to put BRugs in Enhances field. But R CMD check complained about use of require() for a package that is in Enhanced field.


Gregor mailing list Received on Tue Dec 12 19:22:58 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 12 Dec 2006 - 16:31:02 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.