[R-SIG-Mac] (1) Just ignore warning messages? and (2) Using graphics output from R in a Cocoa program

Simon Urbanek simon.urbanek at r-project.org
Sun Sep 2 03:32:39 CEST 2012


On Aug 31, 2012, at 12:12 PM, Paul Johnson wrote:

> I'm looking at using REngine which provide a wrapper for using R from an
> Objective-C/Cocoa program. I checked out the branch from the packages
> repository. I'm currently running Mac OS X 10.7.4 with Xcode 4 and the
> default compiler. The compiler reports one use of a deprecated function and
> I fixed that, I think. I also get 8 warning messages like this:
> 
> <Incompatible pointer types assigning to 'void (*)(const char *)' from
> 'void (char *)'>
> such as for the line
> 
>    ptr_R_ShowMessage = Re_ShowMessage;
> in Rinit.m.
> It appears these warning messages can safely be ignored. Is that a safe
> assumption?
> 

Yes (you could also fix the callbacks instead).


> I also wonder if REngine will give me all the functionality of R.

Not really, it exposes only a subset of R's functionality - REngine was developed to support the Mac GUI so it essentially includes whatever the GUI needs.


> In particular, I want to be able to display graphical output from R in a View.

Cocoa Quartz back-end does exactly that (qdCocoa.m in R if you care - see the QuartzCocoaView class among other things). Probably the easiest way would be to simply let Cocoa Quartz create the view and grab it for yourself. Otherwise you can also take the Cocoa Quartz code and hack it the way you want it (essentially creating another Quartz back-end) but I would not suggest that unless you need to customize the actual view class.

Cheers,
Simon



> Being new at this I'm still studying how this all will work. Can I use
> Quartz or do I need X11? Is there some demo program that provides some
> example of how I might do this?
> 



> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> 



More information about the R-SIG-Mac mailing list