Skip to content
Prev 40866 / 63424 Next

Same class name, different package

A point that has come up a couple of times with the new test is that two 
classes from two packages may be "the same class".  Should that turn on 
duplicate classes?

One situation where the answer seems to be No is when the two classes 
are identical declarations of S3 classes, via setOldClass().

A recent update (rev. 56492) tries to check for equivalent classes, with 
some special leeway for that case, and does not turn on the  duplicate 
class flag.  It's not clear what is really needed or wanted in all 
circumstances, so further experience will be helpful.

If duplicate classes do exist, a utility findDuplicateClasses(details = 
FALSE) will give the names of the duplicated classes.  It's not yet 
exported so you need to call methods:::findDuplicateClasses()

John
On 7/21/11 10:29 AM, John Chambers wrote: