[Rd] request: check version requirements of Suggests package during R CMD build if install required

Dan Tenenbaum dtenenba at fredhutch.org
Fri Apr 3 01:33:38 CEST 2015


Hello,

Say a package (call it pkgA) has this in its DESCRIPTION file:

Suggests: foo (>= 1.2.3)

And yet I only have version 1.2.2 of foo installed, which does not include coolFunction(). pkgA's vignette has this code chunk:

library(foo)
coolFunction()

When I run R CMD build on my package, it will fail, saying that coolFunction() could not be found, but I would prefer it say (like it does in R CMD check):

Package required and available but unsuitable version: 'foo'

This only needs to happen (and only should happen) if R CMD build determines that it needs to install the package (i.e. there is a vignette or there are R expressions in man pages).

I understand that Suggests is sort of a catch all and the package may be used in examples, not in the vignette at all. But the reason for my request is that the error message about coolFunction() being missing seems misleading and doesn't tell me what I really need to do, whereas the proposed message would. 

And if I ran R CMD check first I would know what to do, but I typically run build first, and more importantly, so does the Bioconductor build system, so a package developer looking at our build report would never see the more informative message.

Then R-exts section 1.1.3 would also need to be updated from:

"The ‘Suggests’ field .... Version requirements can be specified, and will be used by R CMD check (and R CMD build, if package installation is necessary)."

Thanks,
Dan



More information about the R-devel mailing list