Skip to content
Prev 21830 / 63424 Next

setMethod("Summary")

Dear Franklin


thank you for this.


Your suggestion works.  But now I'm confused because I'm not sure how  
the
setGeneric() call actually helps.

If I source:

setClass("brob",
          representation = representation 
(x="numeric",positive="logical"),
          prototype      = list(x=numeric(),positive=logical())
          )


max.brob <- function(..., na.rm=FALSE){stop("not YET implemented")}


---ie no call to setGeneric()--- then in an R session I can do the  
following:


R> x <- new("brob",x=6,positive=T)
R> max(x)
Error in max.brob(..., na.rm = na.rm) : not YET implemented


So max(x) calls max.brob() as intended.  Why would a call to  
setGeneric()
be desirable here?  What do I gain from it?


thanks again


Robin
On 4 Sep 2006, at 19:58, Parlamis Franklin wrote:

            
[snipped]


--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743