Re: [Rpy] data.frame element extraction

2011-01-16 Thread Laurent Gautier
On 1/17/11 12:25 AM, Carson Farmer wrote: (...) dataf2 = dataf.rx(-2) > Which works fine, and produces a new data.frame as output print dataf2 >a > 1 1 > 2 2 > 3 3 > However, if I now wanted to remove the last row for instance: dataf3 = dataf2.rx(-3, True) print dataf3 > [1]

[Rpy] data.frame element extraction

2011-01-16 Thread Carson Farmer
Hi list, I have run into a bit of an issue with the R-style element extraction for an robjects.DataFrame. I'll try to explain my issue with an example: >>> d = {'a': robjects.IntVector((1,2,3)), 'b': robjects.IntVector((4,5,6))} >>> dataf = robjects.DataFrame(d) >>> print dataf a b 1 1 4 2 2 5 3