I'm trying to define a new generic, and keep getting an S3 generic/method 
consistency when running R CHECK. All of the code seems to be working, and I'm 
not getting any note, errors, or other warnings.

This minimal example shows the warning I'm getting. The functions are

  myscale <- function(x, y) UseMethod("myscale")
  myscale.default <- function(x) x

The usage section of the man file is

  \usage{
    myscale(x, y)
    \method{myscale}{default}(x)
  }

and the NAMESPACE file is

  export("myscale", "myscale.default")
  S3method(myscale, default)

When I build the package and run CHECK, I get

  * checking S3 generic/method consistency ... WARNING
  myscale:
    function(x, y)
  myscale.default:
    function(x)
  See section 'Generic functions and methods' in the 'Writing R
  Extensions' manual.

As I understand it, there shouldn't be a problem as long as the generic 
function contains all possible arguments of any method, and the methods have 
their arguments in the same order as the generic. It seems that having one 
method with only "x" shouldn't be a problem. I've read the section mentioned in 
the warning, but I can't figure out what's going on. Is any of this wrong?

Jay

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to