[Rd] Conditional "Suggests"

Geoff Jentry geoffjentry at hexdump.org
Mon Apr 11 20:34:06 CEST 2011


Hi ...

I came across an old post on R-devel that describes a situation very 
similar to one I find myself in:
https://stat.ethz.ch/pipermail/r-devel/2006-December/043917.html

As you can see in Gregor's example, the situation is that if I am writing 
Pkg A, I want to detect if Pkg B exists - if so use some functionality 
from there, otherwise do something else.

To me this reads as being in the wheelhouse of what 'Suggests' is supposed 
to imply, as per the R Extensions manual.  The problem here is that if 
PkgB is put down as 'Suggests', it is required for R CMD check to pass 
which seems to defeat the purpose of this exercise a bit.

If one puts it as 'Enhances' one gets a NOTE earlier in check but then the 
WARNING described in this post due to the require() call.

Is there a good way around this situation, such that the PkgA can pass a R 
CMD check if PkgB doesn't exist on the system, for instance a case where 
PkgB isn't available for a particular OS?  If there are multiple methods 
around this problem, is one more blessed by the powers that be than 
others?

Thanks
-J



More information about the R-devel mailing list