Skip to content
Prev 54396 / 63424 Next

binary form of is() contradicts its unary form

Hi Mehmet,
On 11/29/2017 11:22 AM, Suzen, Mehmet wrote:
Yes that's indeed very clear. So if "list" is a super-class
of "data.frame" (as reported by is(data.frame())), then
is(data.frame(), "list") should be TRUE.

With S4 classes:

   setClass("A")
   setClass("B", contains="A")

   ## Get all the super-classes of B.
   is(new("B"))
   # [1] "B" "A"

   ## Does a B object inherit from A?
   is(new("B"), "A")
   # [1] TRUE

Cheers,
H.