[R-SIG-Mac] Directing output to R.app GUI from compiled C code

Simon Urbanek simon.urbanek at r-project.org
Sat Mar 29 22:24:57 CET 2008


Michael,

On Mar 29, 2008, at 2:23 PM, Michael Braun wrote:

> I am a recent convert from Linux to Mac (OS X 10.5.2 on a Mac Pro),  
> and  am trying to direct some output from  compiled C code to the  
> R.app GUI.  For simple things, of course, I use Rprintf from the R  
> API.  But there are other cases (e.g., using the matrix print  
> routines in GSL) for which Rprintf is inappropriate.  When I was in  
> Linux-land, I could direct the output to stdout with no problem (and  
> I can still do that running R from a terminal window on OS X).  But  
> if I run my app under R.app, the output never makes it to the screen  
> (naturally, because R.app is not standard output).
>

If we are to assist you, you should tell us more about your  
application (the C code), because R.app *does* print stdout and stderr  
(just try running system("ls")). Your application is very likely doing  
something to prevent the output from being processed (not flushing the  
output, printing unterminated lines, not allowing R to process  
events...).

Cheers,
Simon


> So, is there an output file that I can use in place of stdout that
> will get my output to the R.app GUI (and preferably, to a terminal
> window session as well)?
>
> Thanks!
>
> Michael
>
>
>
>
> Michael Braun
> Assistant Professor of Management Science (Marketing Group)
> MIT Sloan School of Management
> One Amherst St., E40-169
> Cambridge, MA 02142
> braunm at mit.edu
> 617-253-3436
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>



More information about the R-SIG-Mac mailing list