[Rd] require or import methods?

Roger D. Peng rpeng at jhsph.edu
Fri Aug 20 16:49:47 CEST 2004


I'm developing a package now that creates some S4 classes/methods 
(hence, uses `methods') and also has a namespace.  I'm a little confused 
over whether I should be importing `methods' or require()-ing it.  It 
seems to me that `methods' should be imported since it is needed for 
setGeneric, setMethod, etc.  But, a person using my package will 
probably want `methods' on the search path in order to use functions 
like as() or is().  In this case, should I just require `methods' by 
putting it in the Depends: field (for R >= 2.0.0) and not bother 
importing the namespace?

-roger



More information about the R-devel mailing list