Skip to content

accesing slots of S4 class in C code

5 messages · Aniko Szabo, Duncan Temple Lang, Torsten Hothorn +2 more

#
You need to use .Call() rather than .C() to pass the R object
to the TestFun routine.

 D.
Aniko Szabo wrote:

  
    
#
.Call("TestFun", pd.obj)

should work.

Torsten
#
On 8/17/05, Aniko Szabo <aniko.szabo at hci.utah.edu> wrote:
Your C code is set for the .Call interface, not the .C interface. 
Change the R code to

 res <- .Call("TestFun", pd.obj)
#
Hi Aniko,
On 17 Aug 2005, aniko.szabo at hci.utah.edu wrote:

            
I'm pretty sure you want to use the .Call interface for this sort of
thing, not .C.  

Other than referring you to the Writing R Extensions manual, you might
want to look at the Ruuid package in Bioconductor which is quite
simple, but demonstrates accessing S4 classes from C.

See http://bioconductor.org/ to grab a source package of Ruuid.

Best,

+ seth

PS: Questions of this nature (C code type stuff) are better suited to
the R-devel mail list.