[R-SIG-Mac] How to Call R from a Mac / Cocoa Appliation?

William McKibben wbm13 at mac.com
Thu Jun 13 20:18:11 CEST 2013

Apologies if this has already been answered, but I couldn't find enough to get me going.

I have used Java and R together before, but I'm now porting my app to native Mac OS X and rewriting in Cocoa. I'm pretty clueless about C / C++. I tried and am ready to give up on RInside because Xcode just doesn't like it. I linked to the headers, but Xcode complains about typedef:

/Users/william/Finszer/include/Rcpp/string.h:53:17: Use of undeclared identifier 'internal'.

I can compile RInside examples with the included makefile, but I'm lost as to how to get Xcode to compile. So I moved on to REngine. Through this forum, I saw an RDemo project, which I could not get working. I was, however, able to compile and run the R.app gui, but I got a little (no a lot lost) trying to port some of that code into a new project with ARC.

I have used the REngine for Java, so this would seem logical, just can't get it to work in Xcode. C examples for using R compile but crash with bad access errors at runtime- whatever that means.

I'm pretty comfortable with R and Java, new to Objective C and Xcode, so a working example in Xcode and / or advice on how to make Xcode less C++ dumb would be great. For starters, I'd like R to compute 1+2. Any advice to get my Cocoa program to use R would be greatly, greatly appreciated. 



More information about the R-SIG-Mac mailing list