Re: [Rd] optional package dependency

From: Seth Falcon <>
Date: Sat, 16 Jan 2010 07:49:10 -0800

On 1/15/10 7:47 AM, Simon Urbanek wrote:
> On Jan 15, 2010, at 10:22 , Seth Falcon wrote:

>> I believe another option is:
>>   pkg <- "somePkg"
>>   pkgAvail <- require(pkg, character.only = TRUE)
>>   if (pkgAvail)
>>      ...
>>   else
>>      ...

> That is not an option - that is the code you usually use with Suggests:
> (except for the pkg assignment which is there I presume to obscure things).

Unfortunately, it _is_ an option, just not a good one :-)

Some packages need to dynamically load other packages (think data packages) and they will not know ahead of time what packages they will load. So there has to be some sort of loop-hole in the check logic. In legitimate cases, this is not obscuring anything. In this case, I think we agree the use would not be legitimate.

I'm less and less convinced that the force suggests behavior is useful to anyone. Package repositories can easily attempt to install all suggests and so packages will get complete testing. Package authors should be responsible enough to test their codes with and without optional features. The slight convenience for an author to know that optional packages are missing is at least equally balanced with the slight inconvenience of having to change the check configuration in order to test in the case of missing suggests.

Anyway... mailing list Received on Sat 16 Jan 2010 - 15:52:18 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 Sat 16 Jan 2010 - 19:40:14 GMT.

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

list of date sections of archive