Carson J.Q. Farmer wrote:
> Hi list,
> 
> I have written a simple python application, and I would like to have an 
> R console embedded within it. For simplicity sake, this is essentially a 
> text box which receives user input (R commands), and an text browser 
> (read only) for the R output. Using Rpy this was relatively simple, 
> though most commands had to be wrapped in the R command 'capture.output' 
> to get the desired output.
> 
> Now using Rpy2, I am having trouble reproducing this functionality.

'capture.output' is still available since it is an R function. Could you 
describe what is the trouble ?

> I have used rinterface.setWriteConsole() to catch the console output, but 
> this does not appear to be all console output, as I get (for example) 
> messages from package loading, but not results from 'summary' commands.

Without being more explicit about your code, it is hard to tell.
Did you look at the example of an R GUI implemented with rpy2
(for example at:
http://bitbucket.org/lgautier/rpy2/src/88942b03d72d/demos/radmin.py
)

> In addition, if I don't wrap the commands in the 'capture.output' R 
> command (which essentially turns all output to string), then my 
> application segfaults.

I would be very much interested in having the code that make it crash.
(you can mail it to me off-list if you like).

> My question therefore is: Has anyone else attempted to do this, and if 
> so, how did they successfully reproduce this?
> 
> Cheers,
> 
> Carson
> 
> Ubuntu Linux - 8.10
> Python - 2.5.2
> Rpy2 - 2.0.0

rpy2 is at version 2.0.3. Updating it is recommended.

> R - 2.7.1
> 

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to