>> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
>> should end up as 306 rows by 12 columns.) The rpy2 instructions suggested
>> in this forum were basically: (1) convert my list of lists to a list of
>> array.array()s, (2) convert each array.array() to an RVector,
Actually, I hadn't. But trying it gave me the same "raveled" result:
>>> len(dl)
12
>>> map(len,dl)
[306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306]
>>> x=ro.r['data.frame'](dl)
>>> len(x)
3672
>>>
On Sat, 13 Dec 2008, Marcos Silva wrote:
> Well, I don't know RPy nor Python enought
Gary Strangman wrote:
> Hi again,
>
> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
> should end up as 306 rows by 12 columns.) The rpy2 instructions suggested
> in this forum were basically: (1) convert my list of lists to a list of
> array.array()s, (2) convert ea
Well, I don't know RPy nor Python enought, and maybe I misunderstand your
data structure, but did you tried the RPy corresponding to the R
function"as.data.frame(dl)"
Cheers
2008/12/13 Gary Strangman
>
> Hi again,
>
> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
>