[R] S4 : setGeneric for classical methods

From: <cgenolin_at_u-paris10.fr>
Date: Tue, 22 Jul 2008 18:25:50 +0200


Hi the list (well, half of the list, only the one who are not on holidays...)

I am trying to make an S4 package. When I run it on a console, everything seems ok. When I run R CMD check, I got an error --- 8<



Error in setMethod("plot", "ClassX", function(x, y) { : no existing definition for function "plot"
--- 8< ----------------------

If I add setGeneric("plot",function(x,y,...){standardGeneric("plot")}) in my code, then everything is OK.

This is a surprise for me since I taught that we do not need to redefine as generic the function that are already generic, like "plot". Am I wrong ?

Christophe



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Jul 2008 - 16:29:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jul 2008 - 17:31:56 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive