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

Martin Morgan mtmorgan at fhcrc.org
Thu Oct 9 18:34:48 CEST 2008


"Laurent Gautier" <lgautier at gmail.com> writes:

> Martin,
>
> I saw that I am experiencing the same with an other package,
> and changing the \alias for "[" as you suggest does not seem to clear
> the warning.
>
> I also changed the signature in the .Rd man page, as well as in the
> setMethod definition,
> but without effect on the warning.
>
> Any other hint ?

Hi Laurent --

When I R CMD check on the current svn checkin of altcdfenv, I get the
warning

Undocumented S4 methods:
  generic '[' and siglist 'CdfEnvAffy,character,missing,missing'

looking in man/CdfEnvAffy-class.Rd I find:

\alias{[,CdfEnvAffy, character, missing, missing-method}

Note the spaces after the ','. Changing to

\alias{[,CdfEnvAffy,character,missing,missing-method}

fixes the warning. Note that R CMD check is only verifying the alias,
and that you're responsible for ensuring that the appropriate
documentation is actually on the page.

Hope that helps,

Martin


>
> Laurent
>
>
>
>
> 2008/10/6 Martin Morgan <mtmorgan at fhcrc.org>:
>> 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
>>
>> _______________________________________________
>> Bioc-devel at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>

-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793



More information about the Bioc-devel mailing list