[Bioc-devel] resolving warnings...

Martin Morgan mtmorgan at fhcrc.org
Fri Mar 4 15:31:03 CET 2011


On 03/04/2011 06:23 AM, Stefano Berri wrote:
>> Hope that helps,
>>
>> Martin
> 
> A looot!!!!
> 
> Thank you!
> 
> Still one thing not clear:
> 
>>> Creating a new generic function for "summary" in "CNAnorm"
>>> Creating a new generic function for "as.data.frame" in "CNAnorm"
>>
>> These messages occur once per package, probably your package is called
>> CNAnorm. It means that you have written a method, e.g.,
>> setMethod("summary", ...) without first promoting the plain function
>> 'summary' to a generic, either with setGeneric("summary" <...>) or by
>> importing an appropriate generic or methods from a package that your
>> class depends on, e.g., by adding the package to DESCRIPTION Imports:
>> and NAMESPACE importFrom.
> 
> So I added setGeneric("summary" ...) but now get this message
> 
> ++++++++++++++++++++++++++
> Creating a generic for "summary" in package "CNAnorm"
>     (the supplied definition differs from and overrides the implicit generic
>     in package "base": Classes: "nonstandardGenericFunction",
> "standardGeneric")
> ++++++++++++++++++++++++++
> 
> The reason why I didn't set a Generic in the first place, is because there
> is a "summary" definition in package "base" and, as far as I know, base is
> imported automatically. Similarly, I do not have a generic for "length" but
> have a length method and it does not give me problems...
> 
> Shall I import package base explicitly? or the function "summary"?

'base' functions are standard functions, not S4 generics, and as you say
they are already available within the package name space. If you

> args(summary)
function (object, ...)

you'll see what the current signature is for summary. Make your generic
have the same signature

setGeneric("summary", function(object, ...) standardGeneric("summary"))

or rely the default behavior of setGeneric with

setGeneric("summary")

but I'm not sure that this explains the error message. If not, start a
new R session and load the packages listed in your package Imports:
field. Then try typing

summary

at the command line. Perhaps there is already a generic defined in
package Foo, and you'd like to reuse that using importFrom(Foo, summary).

Martin


> 
> Thanks a lot.
> 
> Stefano
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel


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

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioc-devel mailing list