Mark Larsen wrote:
> I'm taking the plunge and switching over to rpy2.  While, Python to 
> RObjects seems straightforward, what about the reverse? 

It just depends of what you want the reverse to be, I suppose.

> For example, I have a R function which returns a matrix.  How can I get 
> this into a list of lists OR loop over each column (or row) pulling the 
> vector one at a time?  What's the most efficient way to take an RVector 
> to a list? 

Representing a matrix as a list of lists does seem to me as the most 
memory/speed efficient thing to do (especially since you seem concerned 
with efficiency for large structures).

There are more adapted solutions (Numpy being one of them).

> This works -->
> 
>  [i for i in robjects.FloatVector([1,2,3,4])]
> 
> But seems inefficient for large structures.
> 
> Finally, (i swear last question).  How does rpy2 compare in terms of 
> speed to rpy?

I have not done benchmarks.

>  I'm mostly interested in the conversion of data and the 
> initialization.

When initializing R, well... most of the time it takes is used by R itself.

Note that when speed matters, working out things at the rpy2.rinterface 
level
is a good idea. Getting the help of the likes of psyco should help 
(although I have not found the time to try it out).



L.




> Thanks,
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to