Re: [Rd] ASCII dump from an REXP (JRI)

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Wed 19 Jul 2006 - 14:29:08 GMT

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:

> evaluate an R expression. Is there a way to just print, verbatim,
> what R evaluates to the screen (ie just a pure ASCII dump with no
> regard to the data type)?
>

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



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 20 01:44:25 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 19 Jul 2006 - 16:27:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.