[R] S4 base class

Michael Meyer spyqqqdia at yahoo.com
Thu Oct 17 14:43:55 CEST 2013


Meanwhile I have figured out how do do it only to find out that I have more serious problems.
Generally calling Base::f on the base class object is not what you want, instead you want to call
Base::f on the full object for the following reasons:

If the base class is virtual, then Base::f might use virtual functions 
(not defined in Base but defined in derived classes).

If you then call Base::f on an object of class "Base" the call will fail.

Is it possible in R to call Base::f from within Derived (when there is also Derived::f) on the full object this?

I suspect not, which would be a serious drawback to the R class mechanism.


Michael Meyer

More information about the R-help mailing list