Hi, Can anyone tell me how to embed R code in a C++ file. I am actually using a mac running on the OSX 10.6.2 and the IDE Xcode Version 3.2 and I would like to embed the basic function like geometric, binomial, normal and hyper geometric distributions in a sample cpp file. I heard about the library RInside and i have downloaded the source code for mac but i do not know how to build it in order to use it with my IDE XCode. Could anyone help me step by step because I am new in programming to show me how to get this done? Thanks for your help. Mans. -- View this message in context: http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1677784.html Sent from the R help mailing list archive at Nabble.com.
mans wrote:> > Hi, > Can anyone tell me how to embed R code in a C++ file. > > I am actually using a mac running on the OSX 10.6.2 and the IDE Xcode > Version 3.2 and I would like to embed the basic function like geometric, > binomial, normal and hyper geometric distributions in a sample cpp file. > > I heard about the library RInside and i have downloaded the source code > for mac but i do not know how to build it in order to use it with my IDE > XCode. > > Could anyone help me step by step because I am new in programming to show > me how to get this done? > > Thanks for your help. > > Mans. >I use R on OS X, but haven't used Xcode that much- so I can't really offer any advice. However, you may try posting this question on the Mac-specific mailing list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Your question will probably get better answers there. Good luck! -Charlie ----- Charlie Sharpsteen Undergraduate-- Environmental Resources Engineering Humboldt State University -- View this message in context: http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1678051.html Sent from the R help mailing list archive at Nabble.com.
Hello, I don't know specifics of Xcode, etc ... it looks nice but I have not used it myself yet. There seems to be issues on OSX with the current released version of RInside (we will release 0.2.2 soon), so I would suggest you download and install the next version of RInside from r-forge: $ svn checkout svn://svn.r-forge.r-project.org/svnroot/rinside $ cd rinside $ R CMD INSTALL pkg Then you can find example application: $ cd pkg/inst/examples/standard $ make $ ./rinside_sample0 Hello, world! There are several examples in this directory and you can use the Makefile as a template to get the bits and pieces (link against Rcpp and RInside libraries, include path, etc ...) If you have further questions a bout RInside, I would encourage you to use the Rcpp-devel mailing list on r-forge: https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel If you have questions about xcode, ..., then a better place might be the r-sig-mac mailing list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Romain Le 22/03/10 16:25, mans a ?crit :> Hi, > Can anyone tell me how to embed R code in a C++ file. > > I am actually using a mac running on the OSX 10.6.2 and the IDE Xcode > Version 3.2 and I would like to embed the basic function like geometric, > binomial, normal and hyper geometric distributions in a sample cpp file. > > I heard about the library RInside and i have downloaded the source code for > mac but i do not know how to build it in order to use it with my IDE XCode. > > Could anyone help me step by step because I am new in programming to show me > how to get this done? > > Thanks for your help. > > Mans.-- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highlight 0.1-5
No, I didnt install Rcpp but i have R 2.10.1 already installed. What's the difference with Rinside and Rcpp? Do i need both to embed R code in C++ file or just one of them ? Could you tell me where can i get Rcpp pkg? How can i Install it because i dont know how to compile a source file on the terminal. Thanks very much for your help. -- View this message in context: http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1678986.html Sent from the R help mailing list archive at Nabble.com.