Skip to content
Prev 6259 / 12125 Next

[R-pkg-devel] Strange error from CRAN on package submission

HI Uwe,

That might be the key observation. The change to Mercator in this 
package was to add a "show" method to an S4 class. In its NAMESPACE, the 
flexmix package also exports a "show" method.

Both "flexmix" and "Mercator" have an
 ? import("methods")
directive in their NAMESPACE files, which is where the base method for 
"show" comes from. Also, if you just type show at the command prompt to 
see the definition, you get the parenthetical note that
"(This generic function excludes non-simple inheritance' see ?setIs.)"
I don't completely understand what this parenthetical remark? means, but 
I have a suspicion that it is highly relevant to my problem.

If I run
 ? library("Mercator")
 ? showMethods("show")
on a system where flexmix is installed, then the "show" method for 
flexmix (and related objects) is listed, because the flexmix NAMESPACE 
has been attached. If I run the same code on an R system where flexmix 
is not installed, then, of course, neither the NAMESPACE nor the method 
is available.

I suspect (but am by no means certain) that the combination of that 
parenthetical remark above and the existence of the "show" method in the 
suggested package is why I am getting errors on some systems.

But I don't really understand why. My package doesn't need the flexmix 
version of show. And (as Uwe said in an earlier comment), I thought that 
"Suggests" isn't supposed to be inherited. I don't want the flexmix 
NAMESPACE attached, since nothing in my package nor in the packages I 
directly want (Thresher by "Depends" and then moVMF by "Imports") 
actually requires it.

Why does the flexmix NAMESPACE get attached if some other package down 
the line merely suggests it? Is that supposed to happen? To me, it feels 
like a bug in the sense that it surprises the user (i.e., the package 
developer). And I guess is potentially a bug for the ultimate user of 
the package, since it adds a NAMESPACE that was not specifically 
requested by the top level package being loaded.

In any event, what's the best advice now on how to proceed?

Thanks again,
 ? Kevin
On 11/11/2020 11:34 AM, Uwe Ligges wrote: