I'd like to try and rewrite my package to take advantage of S4 methods and name spaces. I am presuming that S4 methods and name spaces will help me write and maintain my package. Can someone suggest a "model" package that uses best practices for mixing S3, S4 methods and name spaces? Preferably a package with multiple R source files. -L
A model package that uses S4 methods and name spaces?
4 messages · rlee@fpcc.net, Douglas Bates, Brian Ripley +1 more
rlee at fpcc.net wrote:
I'd like to try and rewrite my package to take advantage of S4 methods and name spaces. I am presuming that S4 methods and name spaces will help me write and maintain my package. Can someone suggest a "model" package that uses best practices for mixing S3, S4 methods and name spaces? Preferably a package with multiple R source files.
It doesn't mix S3 and S4 but the Matrix package is a large package based on S4 that does show the use of S4 and a NAMESPACE. On a smaller scale, the lme4 package also uses S4 and a NAMESPACE.
On Fri, 13 May 2005, Douglas Bates wrote:
rlee at fpcc.net wrote:
I'd like to try and rewrite my package to take advantage of S4 methods and name spaces. I am presuming that S4 methods and name spaces will help me write and maintain my package. Can someone suggest a "model" package that uses best practices for mixing S3, S4 methods and name spaces? Preferably a package with multiple R source files.
It doesn't mix S3 and S4 but the Matrix package is a large package based on S4 that does show the use of S4 and a NAMESPACE. On a smaller scale, the lme4 package also uses S4 and a NAMESPACE.
The stats4 package in the distribution is intended to be a model in the sense I think we were asked for. It is much smaller than Doug's examples.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
On Fri, 13 May 2005, Douglas Bates wrote:
rlee at fpcc.net wrote:
I'd like to try and rewrite my package to take advantage of S4 methods and name spaces. I am presuming that S4 methods and name spaces will help me write and maintain my package. Can someone suggest a "model" package that uses best practices for mixing S3, S4 methods and name spaces? Preferably a package with multiple R source files.
It doesn't mix S3 and S4 but the Matrix package is a large package based on S4 that does show the use of S4 and a NAMESPACE. On a smaller scale, the lme4 package also uses S4 and a NAMESPACE.
The stats4 package in the distribution is intended to be a model in the sense I think we were asked for. It is much smaller than Doug's examples.
Yes. It doesn't offer much in terms of class hierarchies and the like, though. On the other hand, newcomers to S4 might actually want to avoid that on first contact.
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907