Ulrich Bodenhofer
2012-Dec-11 14:39 UTC
[Rd] Strange, most probably unjustified, codoc mismatch for S4 method with one argument plus '...'
Hi,
I am currently extending one of our CRAN packages and ran into an
unexpected problem when checking the source package. I got some warnings
in the step "* checking for code/documentation mismatches". I double
checked everything and did not see anything that would actually justify
this warning. After testing around for quite a while, I think I can now
pinpoint the problem. In order to make myself clear, I need to explain
the situation in more detail:
The default method (passed as def argument of setGeneric()) has the
formal argument list (x, y, ...). Suppose I want to register a method
with a signature without y, say signature(x="matrix",
y="missing"). If I
pass a function to setMethod() that only has the argument x,i.e.
function(x) {...}, everything works well. It also works well if I
register a function with additional arguments, e.g. function(x,
dummy=NULL, ...){...} (note: y is missing in the definition). However,
if I try to register a function with two formal arguments, x and '...',
i.e.function(x, ...){...}, I get the warning that argument y is present
in the code but missing in the documentation , although it is actually
NOT in the code. In order to make this reproducible for everybody, I put
together a little dummy package in which one of the methods leads to
exactly this warning:
http://www.bioinf.jku.at/people/bodenhofer/codocMismatchTest_0.0.1.tar.gz
Just run 'R CMD check' on this archive and you'll see. You will also
see
from the code and the corresponding documentation that the warning seems
unjustified. I tried the following R versions: 2.12.1, 2.13.0, 2.13.1,
2.14.0, 2.14.1, 2.15.0, 2.15.1, 2.15.2, 2.16.0 (devel), and all
consistently gave the same warning.
Is this a bug or is there a special reason for this behavior? Any help
is gratefully appreciated!
Thanks in advance and best regards,
Ulrich
[[alternative HTML version deleted]]
Maybe Matching Threads
- Strange, most probably unjustified, codoc mismatch for S4 method with one argument plus '...' (re-try)
- Version 1.3.0 of apcluster package on CRAN
- Conflicting definitions for function redefined as S4 generics
- How to address the following: CRAN packages not using Suggests conditionally
- How to address the following: CRAN packages not using Suggests conditionally
