Displaying 1 result from an estimated 1 matches for "r_foo_fun".
2005 Apr 18
3
A 'true' R-wrapper for C++ classes
...++ class:
class foo
{
public:
foo();
~foo();
fun();
}
---------------------
C-wrapper:
extern "C" SEXP R_foo_init()
{
foo* obj = new foo();
SEXP res;
PROTECT(res = R_MakeExternalPtr(obj, R_NilValue, R_NilValue));
UNPROTECT(1);
return res;
}
extern "C" SEXP R_foo_fun(SEXP ptr)
{
foo *ptr = Hello
I am trying to wrap some C++ classes into R.
(1) Comparing the OOP and methods packages, I have came to this conclusion
that OOP works much better for this wrapper -- please correct me if I am
wrong. One question is why this useful package (OOP) is not included in...