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

From: Gregor Gorjanc <gregor.gorjanc_at_bfro.uni-lj.si>
Date: Tue 12 Dec 2006 - 20:50:41 GMT

Kurt Hornik wrote:
>>>>>> Gregor Gorjanc writes:
...
>> 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)) {
>> someSuperDuperFuncFromPkgB()
>> } else {
>> myOwnStuff()
>> }
> 

>> 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.
> 
> 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).  What you describe seems to be a need for conditionally suggesting
> packages, e.g. if it is known that these are only available on certain
> platforms.  I don't think this is currently possible.

OK. Is there some way to test which package is being used i.e. the "standard" or enhanced one? Or to paraphrase this differently. Are there any proposals how "conditional suggest" could be done?

Thanks!

Gregor



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Dec 13 11:51:50 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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.