Skip to content
Prev 54398 / 63421 Next

binary form of is() contradicts its unary form

Yes, data.frame is not an S4 class but is(data.frame())
finds its super-classes anyway and without the need to wrap
it in asS4(). And "list' is one of the super-classes. Then
is(data.frame(), "list") contradicts this.

I'm not asking for a workaround. I already have one with
'class2 %in% is(object)' as reported in my original post.
'is(asS4(object), class2)' is maybe another one but, unlike
the former, it's not obvious that it will behave consistently
with unary is(). There could be some other surprise on the
way.

You're missing the point of my original post. Which is that
there is a serious inconsistency between the unary and binary
forms of is(). Maybe the binary form is right in case of
is(data.frame(), "list"). But then the unary form should not
return "list'. This inconsistency will potentially hurt anybody
who tries to do computations on a class hierarchy, especially
if the hierarchy is complex and mixes S4 and S3 classes. So I'm
hoping this can be addressed. Hope you understand.

Cheers,
H.
On 11/29/2017 12:21 PM, Suzen, Mehmet wrote: