[Rd] Enhances, require() and quality control

Gregor Gorjanc gregor.gorjanc at bfro.uni-lj.si
Thu Dec 7 01:38:04 CET 2006


I am working on a package where Enhances field seems to be a plausible
option. When I add package, say coda, to this field, I get the following
warning with recent R-devel:


* checking for working latex ... OK
* using log directory '/home/ggorjan/programs/R/devel/test.Rcheck'
* using R version 2.5.0 Under development (unstable) (2006-12-06 r40129)
* checking for file 'test/DESCRIPTION' ... OK
* this is package 'test' version '0.1'
* checking package dependencies ... WARNING
'library' or 'require' calls not declared from:

See the information on DESCRIPTION files in the chapter 'Creating R
packages' of the 'Writing R Extensions' manual.


I have require(code) somewhere in the code. Is this OK or is R CMD check
to stringent in case of enhances field - I get no warning if that
package is in depends or suggests fields?

After a short look into src/library/tools/R/QC.R I think that the
following might be the solution. I did not do any other testing than
with my package, where R CMD check (R with proposed change) passed
without warnings.

Index: src/library/tools/R/QC.R
--- src/library/tools/R/QC.R    (revision 40129)
+++ src/library/tools/R/QC.R    (working copy)
@@ -3659,8 +3659,8 @@
     standard_package_names <-
         .get_standard_package_names()$base %w/o% c("methods", "stats4")
     depends_suggests <- c(depends, suggests, pkg_name, contains,
-                          standard_package_names)
-    imports <- c(imports, depends_suggests, enhances)
+                          standard_package_names, enhances)
+    imports <- c(imports, depends_suggests)
     ## the first argument could be named, or could be a variable name.
     ## we just have a stop list here.
     common_names <- c("pkg", "pkgName", "package", "pos")

Lep pozdrav / With regards,
    Gregor Gorjanc
University of Ljubljana     PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                   mail: gregor.gorjanc <at> bfro.uni-lj.si

SI-1230 Domzale             tel: +386 (0)1 72 17 861
Slovenia, Europe            fax: +386 (0)1 72 17 888

"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.

More information about the R-devel mailing list