Re: [Rd] Checking multiple inheritance of S4 objects using R's C API

2021-02-15 Thread Simon Urbanek
Emre, inherits() was designed for S3 classes and at C level only ever works for S3 classes. In S4 world you should use is(). There is no equivalent C-level API for is() so, unfortunately, you likely have to use Rf_eval() of is(x, "class"). At low-level there is R_S4_extends() which allows you

[Rd] Checking multiple inheritance of S4 objects using R's C API

2021-02-15 Thread Emre Gonulates
Hi, Suppose I have the following two classes in R: setClass("Person", representation(name = "character", age = "numeric")) setClass("Employee", representation(boss = "Person"), contains = "Person") I can successfully check inheritance in base R: employee <- new("Employee", name = "Jack", age