From sfalcon at fhcrc.org  Tue Dec 12 22:39:53 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Tue, 12 Dec 2006 13:39:53 -0800
Subject: [Rd] Conditional suggest
In-Reply-To: <457F1621.2080304@bfro.uni-lj.si> (Gregor Gorjanc's message of
	"Tue, 12 Dec 2006 21:50:41 +0100")
References: <4577626C.7020504@bfro.uni-lj.si>
	<17785.51000.419093.552316@mithrandir.hornik.net>
	<457E661D.5070009@bfro.uni-lj.si>
	<17791.3473.773533.683137@mithrandir.hornik.net>
	<457F1621.2080304@bfro.uni-lj.si>
Message-ID: <m21wn423py.fsf@ziti.local>

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



[Rd] Conditional suggest
Seth Falcon