Skip to content
Prev 20078 / 398500 Next

setClass() and packages

We use file names like

 AllClass.R   # definition of classes
 AllGeneric.R # definition of generic functions

(or perhaps AllClasses.R and AllGenerics.R for the fastidious).  As
you say, these are not guaranteed to be processed first but we tend to
use lower case letters for our other .R file names.

By the way, I notice that Robert Gentleman used wrappers like

if (!isGeneric("logDet")) {
    setGeneric("logDet",
               function(object)
               standardGeneric("logDet"), "numeric")
}

in one of his packages in Bioconductor so as to avoid accidently
redefining generics.  I think that is a good idea.


"Henrik Bengtsson" <hb at maths.lth.se> writes: