Skip to content
Prev 23178 / 63421 Next

Enhances, require() and quality control

Kurt Hornik wrote:
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.

Thanks!

Gregor