From tlumley at u.washington.edu  Tue Mar 17 11:45:03 2009
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Tue, 17 Mar 2009 03:45:03 -0700 (PDT)
Subject: [Rd] exporting s3 and s4 methods
Message-ID: <Pine.LNX.4.43.0903170345030.31782@hymn12.u.washington.edu>


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



[Rd] exporting s3 and s4 methods
Thomas Lumley