Skip to content
Prev 59120 / 63421 Next

Bug in R-devel R CMD check --as-cran (was: [R-pkg-devel] Strange error from CRAN on package submission)

I believe the message below on the R-package-devel list is due to a bug 
in R-devel.  The bug doesn't seem to be present in R 4.0.3.

Here's the issue:

The Mercator package Depends on Thresher, which Imports movMF, which 
Suggests flexmix.  In the .onLoad code for movMF, it checks whether 
flexmix is available, and if so, loads it.

Since flexmix sets a method on plot(), its namespace is referred to from 
the plot() method table.

During R CMD check --as-cran Mercator.0.11.4, in the step

* checking whether package ?Mercator? can be installed ...

R prints this warning:

    Warning: namespace 'flexmix'  is not available and has been replaced
    by .GlobalEnv when processing  object '<unknown>'

I believe this message happens when R CMD check is seeing whether the 
package can be installed without undeclared recommended packages.  When 
it tries to load the flexmix namespace in the movMF .onLoad() function, 
it fails, because it can't see "nnet".  Normally it doesn't worry if a 
dependency is declared, but it misses the flexmix declaration of a 
dependency on nnet, presumably because flexmix got loaded in an unusual way.

This is fairly old code, so I'm not sure what change triggered the 
error.  I suppose I could bisect commits to find it, but not today.

Duncan Murdoch
On 11/11/2020 8:44 a.m., Kevin R. Coombes wrote: