[R] help in R calling C function
liulei at l.imap.itd.umich.edu
Sun Jun 27 09:18:43 CEST 2004
I want to call a C function in R. I have some experience on it, but this
time I need to call another C function in the "main" C function. As a
simple example, I use the following C code:
void main(double *alpha)
beta= *alpha *2 + test(*alpha);
double test(double *alpha)
value = *alpha *3;
I used "gcc -c main.c" and "Rcmd SHLIB main.o" and I got the main.dll file.
In R I use the following code to call the C function "main":
But the R system crashed. I know I can only define the function type in C
as "void" to be called by R. But what if I want to call another C function
in the "main" C function? Thank you for your help!
More information about the R-help