Skip to content
Prev 49394 / 63424 Next

common base functions stripping S3 class

On 16/11/2014, 7:58 PM, Murat Tasan wrote:
I don't know of such a list.  If I define a class, I wouldn't assume
that any functions preserve it, unless I specifically write them to do so.

Generally the idea is that the class should be stripped because R has no
way of knowing if the new object, for example unique(obj), still has the
necessary properties to be considered to be of the same class as obj.
Only the author of the class knows that.  S4 would help a bit here, but
only structurally (it could detect when the object couldn't possibly be
of the right class), not semantically.

Duncan Murdoch