Markus Mueller
2014-Jan-24 22:41 UTC
[Rd] Signature specific S4 Method export in NAMESPACE file would be cool
Assume that you have a S4 generic function gf(x) and two methods implementing it, The first for x of class A ( gf#A) and the second for x of class B ( gf#B) I would very much like to be able to: 1.) export only one method e.g. gf#A to be visible for users of the package. 2.) hide gf#B automatically when gf is exported but not the class "B" 3.) hide gf#B in the gf-methods.Rd file produced by package.skeleton More generally one should of course think about any number of arguments e.g. gf(x,y) with y of any of the classes A B or C and methods: gf#A#A gf#A#B gf#A#C gf#B#A ... and so on I would then like to 1.) export methods only for a list of signatures with an extended exportMethod statement in the the NAMESPACE file . whose syntax could look like: exportMethod( gf,signatures=list(c(A,B),c(A,C))) where the omitted signatures argument defaults to the behavior already implemented by exportMethods. 2.) hide any method with a signature >>containing<< a non exported class in case the generic function is exported e.g. if only A is an exported class only gf#A#A would be visible. 3.) as above Background: We strive for a weekly release cycle. It helps very much to be able to implement and test new features without exposing them in the NAMESPACE until we are sure that they will stay. Being able to hide specific methods with specific signatures would help to extend this practice to generic functions which are quite numerous in our package. I'm eager to hear about your thoughts. Thanks in advance for your time. Markus M?ller
Maybe Matching Threads
- NAMESPACE choices for exporting S4 methods
- S4 NAMESPACE method imports and exports do not include (promoted?) generics
- namespace S3 and S4 generic imports cannot both be satisfied:
- namespaces and S4 methods/classes
- Comments on R_exts section 1.6.6, Namespaces with S4 classes and methods