Hello, Is it possible to use R functions (in my case: ks.test()) from C++ -applications? That is, I get the impression R can execute C/C++ code, but is there any possibility to do the opposite? Where can I find help? ------------------------------------------- Ph. D. J??rgen Wallerman Swedish University of Agricultural Sciences Remote Sensing Laboratory S901 83 UME?? ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. ###########################################
Look at "Writing R Extensions" guide. It covers both R-from-C and C-from-R.> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of J??rgen > Wallerman > Sent: Wednesday, May 26, 2004 3:09 AM > To: 'r-help at stat.math.ethz.ch' > Subject: [R] Using R in C++ > > > Hello, > > Is it possible to use R functions (in my case: ks.test()) > from C++ -applications? That is, I get the impression R can > execute C/C++ code, but is there any possibility to do the > opposite? Where can I find help? > > > ------------------------------------------- > Ph. D. J??rgen Wallerman > Swedish University of Agricultural Sciences > Remote Sensing Laboratory > S901 83 UME?? > > ########################################### > > This message has been scanned by F-Secure > Anti-Virus for Microsoft Exchange. > > ########################################### > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help > PLEASE > do read the posting guide! > http://www.R-project.org/posting-guide.html >
I have read the "Writing R Extensions Guide", and got the impression it is only possible to access some "basic" mathematical functions from R in C, not including ks.test(). My question is if it is possible to go further than those "basic" functions. I guess what I want to do is to execute an R function within R but from C++, where all execution is started and controlled from the C-end. For example, it is possible to run R from the prompt with the function as an argument? How do I then get access to the result? Is there a better way than that? Is there a C-interface for ks.test() allowing it to be compiled and included in a C-application? Which parts in the help am I missing? ------------------------------------------- Ph. D. J??rgen Wallerman Swedish University of Agricultural Sciences Remote Sensing Laboratory S901 83 UME??> -----Original Message----- > From: Vadim Ogranovich [mailto:vograno at evafunds.com] > Sent: den 26 maj 2004 17:53 > To: J??rgen Wallerman; r-help at stat.math.ethz.ch > Subject: RE: [R] Using R in C++ > > > Look at "Writing R Extensions" guide. It covers both R-from-C > and C-from-R. > > > -----Original Message----- > > From: r-help-bounces at stat.math.ethz.ch > > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of J??rgen > > Wallerman > > Sent: Wednesday, May 26, 2004 3:09 AM > > To: 'r-help at stat.math.ethz.ch' > > Subject: [R] Using R in C++ > > > > > > Hello, > > > > Is it possible to use R functions (in my case: ks.test()) from C++ > > -applications? That is, I get the impression R can execute C/C++ > > code, but is there any possibility to do the opposite? Where can I > > find help? > > > > > > ------------------------------------------- > > Ph. D. J??rgen Wallerman > > Swedish University of Agricultural Sciences > > Remote Sensing Laboratory > > S901 83 UME?? > > > > ########################################### > > > > This message has been scanned by F-Secure > > Anti-Virus for Microsoft Exchange. > > > > ########################################### > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help PLEASE > > do read the posting guide! > > http://www.R-project.org/posting-guide.html > > >########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. ###########################################
>Hello,Hi Jorgen,> >Is it possible to use R functions (in my case: ks.test()) from C++ >-applications? That is, I get the impression R can execute C/C++ code,but>is there any possibility to do the opposite? Where can I find help?You can use R-(D)COM to call R functions from a C++ application. R-(D)COM is a COM-server and comes with sample code, that shows how to call R from Visual Basic (via the COM-server). If you know, how to access COM objects from C++, you can easily translate the Visual Basic Code to C++. You didn't mention, which platform you are using, of course this works only for Windows. You find R-(D)COM at http://cran.at.r-project.org/other-software.html and the R-(D)COM mailing list at http://mailman.csd.univie.ac.at/pipermail/rcom-l/ Heinz> > >-------------------------------------------Ph. D. J??rgen Wallerman Swedish University of Agricultural Sciences Remote Sensing Laboratory S901 83 UME?? ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. ########################################### This e-mail transmission contains confidential or legally privileged information that is intended for the addressee(s) only. You are hereby notified that any disclosure, copying, distribution or use of the contents of this e-mail is strictly prohibited if you are not the intended recipient. Please inform the sender and delete the message from your system if you have received this e-mail transmission in error. Thank you.