Re: [Rd] Conditional suggest

From: Seth Falcon <>
Date: Tue 12 Dec 2006 - 21:39:53 GMT

Kurt wrote:
>> This is not "enhancing" the way it is currently implemented, which is
>> allowing for the possibility to provide S3 or S4 methods for classes
>> from another package without actively suggesting it (thus enhancing
>> it).

By provide an S4 method for a class, I guess you mean define a method that includes one of the classes in its signature. In any case, I'm pretty sure that one must have the class definition available to define such a method -- I think this means that to define such a method, one must have the package defining the class loaded.

So doesn't "enhancing" imply code like:

   if (require("Fruit"))

       setMethod("grow", "Apple", ...)

Maybe I'm missing something about how enhances is intended to work. I admit to being a bit oversensitive on the issue. I find the current warning about calls to require to be a bit overzelous. We have a number of packages in Bioconductor that contain functions which attempt to load annotation data packages, for example, and these trigger the warning.

While in general, I think it should be possible for package authors to say "this is a package I might load if it is available, but please do R CMD check anyway if it is not available", it doesn't even help with packages that want to load a data package since it is not possible to list all possible data packages ahead of time.

I don't want to start seeing spam in package code like:

   ploader <- get(paste("r", "e", "q", "u", "i", "r", "e", sep=""))    ploader("somePkg")

just to avoid a warning message. But warnings from R CMD check, for our project, have substantially less value as more of them become "oh, that is an OK warning message".

Maybe I've strayed too far off topic here. Sorry.

+ seth mailing list Received on Wed Dec 13 12:54:10 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 Wed 13 Dec 2006 - 02:30:58 GMT.

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