Re: [R] accesing slots of S4 class in C code

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Thu 18 Aug 2005 - 23:50:38 EST

Hi Aniko,

On 17 Aug 2005, aniko.szabo@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.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Aug 19 00:02:50 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:29:21 EST