Skip to content
Prev 26971 / 398500 Next

comparing class() -- R=NULL and S+=numeric

"Rex_Bryan at urscorp.com" <RexBryan1 at attbi.com> writes:
I suspect that the answer is actually somewhere in MASS4, but I don't
have it at hand right now. 

Basically there have been two class systems in S(-PLUS), S3 and S4,
and R is (mostly) compatible with the former as represented by S-PLUS
3.x.

In S3, classes are really just text attributes, and if none is
present, the class is NULL. However, you can ask for data.class(x) and
get - essentially - its mode. E.g.,
[1] "numeric"

S4 classes introduce a stricter system where all objects have a class.
This is what is used in current versions of S-PLUS. In R, we have the
"methods" library, which changes the behaviour of R to be like S4:
[1] "numeric"