Hi Patrick, Patrick Giraudoux <[EMAIL PROTECTED]> writes: > OK. Looks like I have got it... going through the source code of sp, > classes are declared as usual functions in *.R files.
I'll add in a few suggestions that I have found useful for developing heavily S4 classes (you don't have to do it this way, your life may not be better if you do, etc): File organization: * Put all setClass calls in AllClasses.R * Put all setGeneric calls in AllGenerics.R * Put setMethod("foo", ...) calls in foo-methods.R Other: * use a NAMESPACE file Why do I find this helpful? With all of the classes in one place it is easy to see what *things* the package defines, how they are structured, and how they relate to each other. Similarly, having all the generics in one place provides a nice overview of the behaviors defined by the package. Methods separate from the classes makes sense because in S4 methods don't belong to classes. Since classes and methods are decoupled in S4, it makes sense to me to organize them that way in the source code. Best, + seth ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html