[R] accesing slots of S4 class in C code

Seth Falcon sfalcon at fhcrc.org
Thu Aug 18 15:50:38 CEST 2005


Hi Aniko,

On 17 Aug 2005, aniko.szabo at hci.utah.edu wrote:

> I am trying to use a custom S4 object in my C code and I cannot get
> the access to its slots working.
>
> The following is a toy example, but even this crashes. 
> res <- .C("TestFun", pd.obj)

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.




More information about the R-help mailing list