[R] Problem with .C

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Oct 5 04:30:42 CEST 2011


Hi,

As other have said, it's very difficult to help you without an example
+ code to know what you are talking about.

That having been said, it seems as if you are just getting your feet
wet in this R <--> C bridge, and I'd recommend you checkout the "Rcpp"
and "inline" package to help make your life a lot easier ...

-steve

On Tue, Oct 4, 2011 at 8:04 AM, Grigory Alexandrovich
<alexandrovich at mathematik.uni-marburg.de> wrote:
> Hello,
>
> I wrote a function in C, which works fine if called from the main-function
> in C.
>
> But as soon as I try to call this function from R like .C('foo',
> as.double(x), as.integer(y)), the programm crashes.
>
> I created a dll with the cmd command R --arch x64 CMD SHLIB foo.c and loaded
> it into R with dyn.load().
>
> What can be the cause of such behaviour?
> Again, the C-funcion itself works, but not if called from R.
>
> Thanks
> Grigory Alexandrovich
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list