Hi, my question is How i cant to execute c code within R for example name of program probe.c (in workpath of R) #include<stdio.h> void main(){ int x; scanf("%d\n",&x) printf("%d\n",x) } and in R i make .c("probe.c") i'm obtain no load table simbol, but i compile the program with Borland C 5.0 and obtain the .obj archive (probe.obj and the .exe).I have to make the load in R?. What is wrong?, Thanks Ruben
solares at unsl.edu.ar wrote:> Hi, my question is How i cant to execute c code within R for example > name of program probe.c (in workpath of R) > #include<stdio.h> > void main(){ > int x; > scanf("%d\n",&x) > printf("%d\n",x) > } > and in R i make > .c("probe.c") > i'm obtain no load table simbol, but i compile the program with Borland C > 5.0 and obtain the .obj archive (probe.obj and the .exe).I have to make the > load in R?. What is wrong?, Thanks RubenYour mistake was that you have read neither a) the R for Windows FAQ, Section 7.3 "How do I include compiled C code?", nor b) the manual "Writing R Extensions". Uwe Ligges
I strongly encourage you tho check this book: The basics of S and S-Plus / Andreas Krause, Melvin Olson It has a very detailed and easy to follow info on how to link C code with S (which is nearly identical to R). The R documentation is certainly very complete, but it is written for people that already has some good knowledge. The book by Krause and Olson helped me a lot in writing some C code for calculating fractals in R. Hope this helps.