$ operator in R

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

$ operator in R


I am wrapping C++ into R with SWIG.
I have a class that inherits from two other classes.

Class child : public parent_one, parent_two
    void child_function();

class parent_one
    void parent_one_func()

class parent_two
    void parent_two_func()

If child_instance is an instance of the child class, then in R I have the following:

> is(child_instance)
[1] "_p_child_instance"
[2] "_p_parent_one"
[3] "_p_parent_two"
[4] "C++Reference"
[5] "ExternalReference"

I can call
> child_instance$parent_one_func()
without an error. Even if I have a input variable and I dont give it, he will find the function and tell me that I missed to give the input variable.

But if I know:
> child_instance$parent_two_func()
Error in (function (classes, fdef, mtable)  :
 unable to find an inherited method for function ‘addNextMethod’ for signature

I get the error above.
Does anybody know what I am missing?
Thank you all in advance!
BR Akira