[Rd] Package 'nlme' fails 'make check-all' in R 2.12.0 patched built from source

Marc Schwartz marc_schwartz at me.com
Fri Oct 15 20:27:21 CEST 2010


Hi all,

I am building R 2.12.0 patched this morning from source on Snow Leopard (10.6.4). In fact, three times now, with separate clean source and build directories each time, just to be sure that the issue is predictable.

I would be happy to have somebody tell me that I am missing something fundamental here also...


After running make check-all, I get the following error for 'nlme':

* using log directory ‘/Users/marcschwartz/R.Files/SourceCode/32bitR/tests/nlme.Rcheck’
* using R version 2.12.0 Patched (2010-10-15 r53323)
* using platform: i386-apple-darwin10.4.0 (32-bit)
* using session charset: UTF-8
* checking for file ‘nlme/DESCRIPTION’ ... OK
* this is package ‘nlme’ version ‘3.1-97’
* checking package name space information ... OK
* checking package dependencies ... ERROR
Package required but not available: Hmisc

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



From what I can tell, nlme is the only core/recommended package that now has a "Suggests" in the DESCRIPTION file for a non-core/non-recommended package. This Suggests for Frank's Hmisc appears to be new as of version 3.1.-97 of nlme. 

A search of the examples/tests for nlme yields an example in augPred_lab.R as follows, which appears to be the only code based reference to Hmisc in the nlme package:

library(nlme)
if(require("Hmisc")) {
    T.aug <- Orthodont
    label(T.aug$age) <- 'anyL'
    foo <- augPred(lme(distance ~ age, random = ~1|Subject, data=T.aug))
    ## failed in 3.1-72
}

## failed even if there is a variable with a class that is not being used.
T.aug <- Orthodont
T.aug$newage <- T.aug$age
class(T.aug$newage) <- 'anyC'
foo <- augPred(lme(distance ~ age, random = ~1|Subject, data=T.aug))
## failed in 3.1-72



The above example/test is not new to the package, so it would seem that something has changed in the handling of Suggests in the package DESCRIPTION file in 2.12.0.

A check of the log for nlme on CRAN does not reveal any problems for 2.12.0, but presumably since Hmisc would be available there, the check would not logically fail, whereas with a clean local build not containing any add-on packages, it would.


Running R CMD check from the CLI directly on the nlme package using 2.12.0 yields:

./R CMD check nlme_3.1-97.tar.gz
* using log directory ‘/Users/marcschwartz/R.Files/SourceCode/32bitR/bin/nlme.Rcheck’
* using R version 2.12.0 Patched (2010-10-15 r53329)
* using platform: i386-apple-darwin10.4.0 (32-bit)
* using session charset: UTF-8
* checking for file ‘nlme/DESCRIPTION’ ... OK
* this is package ‘nlme’ version ‘3.1-97’
* checking package name space information ... OK
* checking package dependencies ... ERROR
Package required but not available: Hmisc

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


whereas running R CMD check using 2.11.1 patched on the same new version of nlme does not yield an error. So, again, it would seem that something has changed in 2.12.0. 

From a review of R-Exts, the following language was in 2.11.1 patched in section 1.1.1 for the 'general rules':

All packages that are needed to successfully run R CMD check on the package must be listed in one of ‘Depends’ or ‘Suggests’ or ‘Imports’.


whereas in 2.12.0:

All packages that are needed to successfully run R CMD check on the package must be listed in one of ‘Depends’ or ‘Suggests’ or ‘Imports’. Packages used to run examples or tests conditionally (e.g. via if(require(pkgname))) should be listed in ‘Suggests’ or ‘Enhances’. (This allows checkers to ensure that all the packages needed for a complete check are installed.)


So, without looking through code in the 'tools' package yet, it would seem that the tests in 2.12.0 are perhaps intended to be more rigorous, although I did not see an obvious change in the language in the 'checking packages' section of R-Exts, under bullet number 5 regarding the tests aborting.
 
This leads me to the question, in the case of nlme, should R CMD check fail if Hmisc is not present in a clean build tree? Or, should the use of Hmisc in the example be removed along with the Suggests entry in the DESCRIPTION file, such that none of the core/recommended packages are dependent upon any third party packages?

The former may be a functional issue, whereas the latter would seem to me to be an appropriate policy issue (not specifically pertaining to Hmisc or Frank, of course).

Thanks,

Marc Schwartz



More information about the R-devel mailing list