[Rd] S4 package warning

Robin Hankin rksh1 at cam.ac.uk
Wed Nov 10 10:53:30 CET 2010


Hello everyone.  R-2.12.0, suse linux 11.3.

I am debugging a package that uses S4 methods
and R CMD check gives the following warning:

> Warning in methods::findMethods(g, env) :
>   non-generic function 'mdm' given to findMethods()
> See the information on DESCRIPTION files in the chapter 'Creating R
> packages' of the 'Writing R Extensions' manual.

I don't see anything obvious in that part of the R-exts but
FWIW, here is my DESCRIPTION file:

> Package: multivator
> Type: Package
> Title: A multivariate emulator
> Version: 1.0-1
> Depends: R(>= 2.10.0), emulator, methods, utils
> Date: 2009-10-27
> Author: Robin K. S. Hankin
> Maintainer:  <hankin.robin_nospamAT_gmail.com>
> Description: A multivariate generalization of the emulator package
> License: GPL-2
> LazyLoad: yes


I think that the lines in question in my package are:

> setClass("mdm", # "mdm" == "multivariate design matrix"
>          representation = representation(
>            xold  = "matrix",
>            types = "factor"
>            )
>          )
>
>
> setGeneric("mdm",function(xold,types){standardGeneric("mdm")})
> setMethod("mdm",signature("matrix","factor"),function(xold, types){
>   new("mdm", xold=xold, types=types)
> } )

which appear to execute without warning on a virgin console.  In the
package, there are three
or four other S4 classes which are on the same footing as the mdm class,
but do not appear to generate a warning from R CMD check.
The same happens AFAICS on R-2.13, 53543

Can anyone advise on how to deal with the warning?

thank you

Robin




-- 
Robin K. S. Hankin
Uncertainty Analyst
University of Cambridge
19 Silver Street
Cambridge CB3 9EP
01223-764877



More information about the R-devel mailing list