[R] Embed R code in C++

Romain Francois romain at r-enthusiasts.com
Mon Mar 22 20:30:41 CET 2010


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



More information about the R-help mailing list