[Rd] generic function S3 consistency warning advice

Robin Hankin r.hankin at noc.soton.ac.uk
Thu Sep 1 15:57:01 CEST 2005


Hi

section 6.1 of R-exts suggests that a package  can take over a  
function in the base
package and make it generic.

I want to do this with Re() and have the following lines in my R code:



"Re" <- function(x){UseMethod("Re" )}
"Re.default" <- get("Re" ,pos=NULL,mode="function")
"Re.octonion" <- function(x){give.comp(x,1)}

This, however, generates the following warning from R CMD check:

* checking S3 generic/method consistency ... WARNING
Re:
   function(x)
Re.default:
   function()

See section 'Generic functions and methods' of the 'Writing R  
Extensions'
manual.



I can suppress the warning by commenting out the first line.  Is this a
sensible thing to do?




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



More information about the R-devel mailing list