[Rd] How to deal with functions detected as apparent S3 methods

Xavier Robin xavier.robin at bric.ku.dk
Tue Feb 10 15:25:20 CET 2015


Dear list,

I am trying to clear the following note that is generated by an R CMD
check --as-cran on my package (pROC):
> * checking S3 generic/method consistency ... NOTE
> Found the following apparent S3 methods exported but not registered:
>   ci.auc ci.coords ci.se ci.sp ci.thresholds roc.test
> See section ‘Registering S3 methods’ in the ‘Writing R Extensions’
> manual.
However, these functions are (at least intended to be) actual functions,
not methods.
The reason these messages are generated is that I define two generic
functions ci and roc. Due to the S3 rules, these 6 functions are
accidentally recognized as methods of those generics. But it has never
been in my intention to do so.

I just fixed a bunch of these notes (see
<http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/pROC-00check.html>
for instance) that were pointing at actual errors, but these remaining 6
are definitely "correct", at least in the sense that registering them as
S3 method instead of exporting them would break quite some code
(including the doc and examples of the package).

(This is additionally made even more complex by the fact that 'ci.auc'
could actually be used as a method, although that usage is not
documented (it would then be a method that further delegate to other
methods). It is not the case of the other 5 functions.)

I guess the naming was a bit unfortunate... but it happened 5 years ago
and it is quite difficult to change now.

How can I fix this? I can see two ways to go here:

* Deprecate these functions and replace them with some underscore
version (ci_auc, etc.)
It might take some time for the usage to change but I'm sure I can
convince CRAN to accept the package if some transition action is taken...

* Just ignore the note: after all it is just an automated test, I never
had any issue with this, nor heard anyone complaining about this before.
I can't find anything specifically advising against this usage in the
docs, but maybe I just overlooked it?

Any advice on how to address this problem would be appreciated.

Best wishes,
Xavier

-- 
Xavier Robin, PhD
Cellular Signal Integration Group (C-SIG)  - Linding Lab
Biotech Research and Innovation Center (BRIC) - University of Copenhagen
Anker Engelundsvej, DTU Campus, Building 301, DK-2800 Lyngby, DENMARK
Mobile: +45 42 799 833
www.lindinglab.org - www.bric.ku.dk



More information about the R-devel mailing list