Skip to content

'R CMD check' fails when suggested package is not available

4 messages · Hervé Pagès, Brian Ripley, Jari Oksanen

#
Hi there,

I was wondering why I get the following error message:

  * checking package dependencies ... ERROR
  Packages required but not available:
    Rmpi

when I run 'R CMD check' on a package that _suggests_ Rmpi?
Why isn't it OK to not have all the suggested packages installed?

Maybe one of the 3 following behaviours would be more appropriate:

  a) Having the error saying something like:

    Package suggested but not available:
      Rmpi

  b) Make this a warning instead of an error.

  c) Don't do anything at all for suggested packages.

This issue showed up today while I was checking a new Bioconductor package:
the package suggests Rmpi but the vignette and the examples don't use it. If I remove
Rmpi from the Suggests field then 'R CMD check' runs all the examples and re-create
the vignette with no problem. Most users will not have Rmpi on their machine neither
will they be interested in getting into the trouble of installing it.
The package I was checking suggests Rmpi only because it contains 1 function that tries
to use it if it's installed but will work perfectly fine otherwise.
In this case it seems reasonable to have Rmpi in the Suggests field but this will
make 'R CMD check' to fail which is problematic in the context of automated builds :-/
If 'R CMD check' can't be a little bit more relaxed about this, then I guess we will
need to remove Rmpi from the Suggests field, but then 'R CMD check' will complain that:

  * checking for unstated dependencies in R code ... WARNING
  'library' or 'require' calls not declared from:
    Rmpi

which is always better than getting an ERROR.

Thanks!

H.
#
This is a configurable option 'R_check_force_suggests' documented in 
'Writing R Extensions'.

This package should be using Enhances: Rmpi, it seems.
On Wed, 4 Apr 2007, Herve Pages wrote:

            
'Most users' will not be running 'R CMD check', of course.

  
    
#
On Wed, 2007-04-04 at 17:05 -0700, Herve Pages wrote:
Hi there too,

This has been discussed before:
http://tolstoy.newcastle.edu.au/R/devel/05/09/2326.html

Then the Core decided to maintain the Mafia style suggestion ("that you
can't refuse"), but later seems to have introduced a new field
"enhances" which to me looks like a suggestion in the meaning of the
word I know: a suggestion that you can refuse.

I think that the R-ext description is somewhat confusing and misleading
for fields "Requires", "Suggests", "Enhances". The R extension manual
"suggests" different situations where the author of the manual thinks
that other people would like to use these fields. However, the manual
does not clearly say what are the practical and real consequences of
selecting a certain entry. It seems that "Requires" means that a package
is always required, "Suggests" means that the package is required in
check (with a threat of error), but only suggested for normal use, and
"Enhances" means that the package only is suggested. It does not matter
whether the package really "enhances" anything, but this is the meaning
of the word in behaviouristic sense. 

cheers, jari oksanen

  
    
6 days later
#
Prof Brian Ripley wrote:
Thanks for pointing this to me. I tried "R-2.5 CMD check --help" but was not
very successful with it...
Yep this sounds like what we need here (never heard about this field before,
will be the first time a Bioconductor package uses it).

Is there any reason why the "Enhances" field is not supported by install.packages?

  > install.packages("XML", dep="Enhances")
  Error in as.vector(available[p1, dependencies]) :
        subscript out of bounds

I know this is in sync with the man page for 'install.packages' (which only
mentions Depends, Imports and Suggests) but there are for sure people that would
like to be able to install a package with _all_ its capabilities (especially those
that enhance it) by just doing
  > install.packages(..., dependencies=TRUE)
and not having to look at its DESCRIPTION file in order to figure out what great
enhancements there are missing and then install them separately ;-)

BTW, the name of this field ("Enhances") and the documentation does not help
to understand the "direction" of the enhancing relationship (who enhances who?):
both (the name "Enhances" and the 'Writing R Extensions' manual) tend to say that
the packages listed in the field are enhanced by the package at hand. That's a
point of view. But IMO it's rather the package at hand that is enhanced by the
packages listed in the field (at least this is the case with Rmpi).

Cheers,
H.