[R-pkg-devel] Any new developments on "apparent S3 method" issue?
Lenth, Russell V
russell-lenth at uiowa.edu
Wed May 3 18:39:41 CEST 2017
Package developers list:
I recently added an 'as.mcmc.list' method for objects in one of my packages. Now, in doing an --as-cran check, I get this message:
* checking S3 generic/method consistency ... NOTE
Found the following apparent S3 methods exported but not registered:
as.mcmc.list
See section 'Registering S3 methods' in the 'Writing R Extensions' manual.
Apparently, the checking routines conclude that I should register an 'as.mcmc' method for class "list" -- something that does not exist and is not needed. I did some searching, and found an exchange on this issue from January 2015, in which a "nonS3Method()" construct was proposed. That sure looks like what is needed, but it still doesn't exist. Is there a different way to handle this that has been developed?
Further information -- this is related to the *coda* package, and my NAMESPACE file contains this code:
if (requireNamespace("coda", quietly = TRUE)) {
importFrom(coda, as.mcmc, as.mcmc.list)
export(as.mcmc, as.mcmc.list)
S3method(as.mcmc, ref.grid)
S3method(as.mcmc.list, ref.grid)
}
This seems clear enough; and what's mysterious is that *coda* passes the CRAN checks without this same NOTE.
As a possible workaround, I am considering:
-- providing and registering my own S3 method 'as.mcmc' for class "list" --- in spite of my disinterest in providing this
-- not importing coda::as.mcmc.list and instead exporting my own generic that handles objects of class "list" separately
Any suggestions?
Russ
Russell V. Lenth - Professor Emeritus
Department of Statistics and Actuarial Science
The University of Iowa - Iowa City, IA 52242 USA
Voice (319)335-0712 (Dept. office) - FAX (319)335-3017
More information about the R-package-devel
mailing list