Hi List,

Apologies if this has already been covered, I didn't see anything in the 
archives...

I seem to be having trouble getting rinterface.setWriteConsole to work 
for me on Windows...

rpy2.__version__
'2.0.6' (Linux)
'2.0.3' (Windows)

For example, on Windows I get:
 >>> import rpy2.robjects as robs
 >>> result = robs.r("print(c(1,2,3,4,5))")
[1] 1  2  3  4  5
 >>> def f(output):
...     print "****"
...     print output
...     print "****"
...
 >>> robs.rinterface.setWriteConsole(f)
 >>> result = robs.r("print(c(1,2,3,4,5))")
[1] 1  2  3  4  5

Whereas on Linux, I get:
 >>> import rpy2.robjects as robs 
 >>> result = robs.r("print(c(1,2,3,4,5))")
[1] 1 2 3 4 5
 >>> def f(input):
...     print "****"
...     print input
...     print "****"
...
 >>> robs.rinterface.setWriteConsole(f)
 >>> result = robs.r("print(c(1,2,3,4,5))")
****
[1]
****
****
 1
****
****
 2
****
****
 3
****
****
 4
****
****
 5
****
****


****

Am I doing something wrong here?
Is there some kind of workaround to get these working similarly (as in 
the Linux case)?

Thanks for any advice,

Carson

-- 
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
National University of Ireland, Maynooth,
Email: carson.far...@gmail.com
Web:   http://www.carsonfarmer.com/
       http://www.ftools.ca/


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to