Re: [Rpy] Adding columns to DataFrames

2012-08-21 Thread Carlos Pita
Hi all, empty.rx2[New] = [str(item) for item in range(len(empty.rownames))] RRuntimeError: Error in `[[-.data.frame`(list(), New, list(0, 1, 2, 3, 4, : argument value is missing, with no default Anything I'm doing wrong? Not necessarily; I think that you are reaching

Re: [Rpy] Adding columns to DataFrames

2012-08-21 Thread Carlos Pita
is needed is a rx, rx2 equivalent for $. Is there something like that in rpy2? Regards -- Carlos On Tue, Aug 21, 2012 at 1:56 PM, Carlos Pita carlosjosep...@gmail.com wrote: Hi all, empty.rx2[New] = [str(item) for item in range(len(empty.rownames))] RRuntimeError: Error

Re: [Rpy] Adding columns to DataFrames

2012-08-21 Thread Carlos Pita
(s/mm/newcol/ in the error message above) On Tue, Aug 21, 2012 at 2:25 PM, Carlos Pita carlosjosep...@gmail.com wrote: Mh, this is interesting: dataf = r['[-'](dataf, 'newcol', R.IntVector([1,2,3])) = Error in `[-.data.frame`(list(a = 1:3, b = 4:6, mm = 1:3), mm, 1:3) : argument

[Rpy] Passing expressions to be evaluated by functions

2013-04-27 Thread Carlos Pita
Hi all, I would like to know if there is a way to pass an r expression to be lazy evaluated by a function. I mean as in transform or within. For example: r.transform(r['data.frame'](a=r.c(1,2,3)), a=a+1) The part a+1 is the one I want to achieve somehow. I know I could just call: