Re: [Rpy] a few high-level questions about rpy2 and a question about matrix indexing

2008-06-30 Thread Michael Sorich
With regard to R indexing on the objects have you thought about using the __getitem__ method of an attribute. E.g. python indexing m[:,1], r indexing m.r[:,2] class RIndex(object): def __init__(self, parent): self.parent = parent def __getitem__(self, index): return self.

[Rpy] strange conversion of a python list

2008-05-07 Thread Michael Sorich
I have noticed that a python list containing python scalars is converted to a R vector but a python list containing robjects (vectors of length 1) is converted to a R list. See example below. Is this a bug? Thanks, Michael from rpy import * set_default_mode(NO_CONVERSION) r.print_(r.c(1,2,3)

[Rpy] class conversions of lists and vectors

2006-11-17 Thread Michael Sorich
Hi, The class conversion example from section 4.3.2 of the manual demonstrates how to apply a conversion function to dataframes. However, I am having difficulty doing this for lists and vectors. In the example below the function is applied to the dataframe, but not to the list. The manual mentio

[Rpy] class conversions of lists and vectors

2006-11-12 Thread Michael Sorich
Hi, The class conversion example from section 4.3.2 of the manual demonstrates how to apply a conversion function to dataframes. However, I am having difficulty doing this for lists and vectors. In the example below the function is applied to the dataframe, but not to the list. The manual