Skip to content
Prev 21490 / 63424 Next

ASCII dump from an REXP (JRI)

Adam,

please use stats-rosuda-devel or private mail, your mail ended up on  
R-devel again ...
On Jul 18, 2006, at 10:56 PM, way4thesub wrote:

            
Probably the easiest is (replace "a" with any expression you want to  
show):

System.out.println(reng.eval("paste(capture.output(print 
(a)),collapse='\n')").asString());

Another alternative is to use callbacks - i.e. create a class that  
implements RMainLoopCallbacks and simple reng.eval("print(a)"); will  
cause rWriteConsole to be called with the output. This approach is  
more suitable for console-like GUIs.

Cheers,
Simon