[Rd] Conditional "Suggests"

From: Geoff Jentry <geoffjentry_at_hexdump.org>
Date: Mon, 11 Apr 2011 11:34:06 -0700


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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 11 Apr 2011 - 18:37:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Apr 2011 - 22:00:44 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.

list of date sections of archive