[Rd] exporting s3 and s4 methods

Thomas Lumley tlumley at u.washington.edu
Tue Mar 17 11:45:03 CET 2009


If a package defined an S3 generic and an S4 generic for the same function (so as to add methods for S4 classes to the existing code), how do I set up the namespace to have them exported?

With 
import(stats)
exportMethods(bigglm)
importClassesFrom(DBI)
useDynLib(biglm)
export(biglm)
export(bigglm)
in NAMESPACE, the S3 generic is not exported.
> methods("bigglm")
[1] bigglm.RODBC*      bigglm.data.frame* bigglm.function*

    Non-visible functions are asterisked
Warning messages:
1: In findGeneric(generic.function, parent.frame()) :
   'bigglm' is a formal generic function; S3 methods will not likely be found
2: In methods("bigglm") : function 'bigglm' appears not to be generic


[This is R 2.7.2, admittedly a little ancient]

       -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-devel mailing list