David Marks wrote:
> Hi,
> 
>     I'm just getting used to the rpy module and so far I think it's 
> pretty great.  One thing I haven't figured out though is how to print R 
> formatting.  Here's my exact problem.  I want to print the "summary" of 
> an lm object in the same format that it prints in R.  Here's the R version:
>  > y = c(3,4,5,6)
>  > x = c(1,1,2,2)
>  > summary(lm(y~x))
> ...
> Is there anyway to get the print statement to give me the same nice 
> formatting as I get in R?  Thanks,

In R, when you do this:

summary(lm(y~x))

it is actually expanded into:

print(summary(lm(y~x)))

To call R's print function from python, I think you need to use the 
rpy.r._print (remember that print is a reserved word in python).

You could also try rpy.r('print(summary(lm(y~x)))') instead.  Note I 
have not tested this, but am going on past experience.

Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to