[Bioc-devel] problem with S4 class/methods documentation

Martin Morgan mtmorgan at fhcrc.org
Mon Oct 6 18:46:47 CEST 2008


Hi Mattia --

Probably you're having difficulty reproducing because your version of R 
is slightly lagging compared to those on the build systems. Here's the 
generic signature for '[':

 > getGeneric("[")
standardGeneric for "[" defined from package "base"

function (x, i, j, ..., drop = TRUE)
standardGeneric("[", .Primitive("["))
<environment: 0x82471f0>
Methods may be defined for arguments: x, i, j, drop
Use  showMethods("[")  for currently available ones.

Note there are 4 arguments available for dispatch (x, i, j, drop). Your 
method signature is implicitly [,MEDMEset,ANY,ANY,ANY -- you haven't 
specified a class for i, j, or drop, so they default to matching ANY 
type of object.

You mention documentation for

\alias{[,MEDMEset-method}

Change this to

\alias{[,MEDMEset,ANY,ANY,ANY-method}

and I think you'll be set. I'm not sure whether this is an intentional 
increase in stringency in documentation on R's part.

In reality your method probably accepts i="numeric" or "character", j = 
"missing", and drop = "logical" (or perhaps "missing", depending on your 
code). One might want to change your setMethod definitions and 
documentation aliases to reflect this (though it's not really clear that 
this will help the end user experience).

Martin

mattia pelizzola wrote:
> Hi,
> 
> I have a warning on the check report of my package MEDME (BioC 2.3
> devel) that I do not know how to deal with. I can't reproduce the same
> warning on my computer so it is difficult test possible solutions as I
> continuously have to wait for the online update. This warning is
> consistent over all the tested OSs:
> 
> * checking for missing documentation entries ... WARNING
> Undocumented S4 methods:
>   generic '[' and siglist 'MEDMEset,ANY,ANY,ANY'
> All user-level objects in a package (including S4 classes and methods)
> should have documentation entries.
> 
> 
> Unfortunately, I have no idea what the " siglist
> 'MEDMEset,ANY,ANY,ANY' " refers to.
> 
> Regarding the "[" method, here are some extracts from my MEDMEset-class.Rd file.
> I already included an alias for the "[" method:
> 
> \name{MEDMEset-class}
> \docType{class}
> \alias{MEDMEset-class}
> \alias{[,MEDMEset-method}
> .....
> 
> 
> 
> as well as the method description:
> 
> ......
> \section{Methods}{
>   \describe{
>     \item{[}{\code{signature(x = "MEDMEset")}: subsets the object
> based on its probes and/or samples}
> .......
> 
> 
> I used the promptClass function to generate a first version of this Rd
> file. I did not use the promptMethods function though, and it is not
> clear to me when to use it.
> 
> Many thanks for any advice,
> 
> mattia
> 
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list