Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Laurent Gautier
On 2013-03-21 07:44, Luca Beltrame wrote: In data giovedì 21 marzo 2013 15:38:22, Thomas Kluyver ha scritto: With a list, yes. With a numpy array, which is probably as relevant for many rpy2 users, adding an integer adds it to every element: That was actually the reason I expected it to work.

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Laurent Gautier
On 2013-03-21 07:36, Thomas Kluyver wrote: > On 21 March 2013 14:28, Laurent Gautier > wrote: > > In Python this is an error. > >>> x+3 > Traceback (most recent call last): > File "", line 1, in > TypeError: can only concatenate list (not "int") to

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Luca Beltrame
In data giovedì 21 marzo 2013 15:38:22, Thomas Kluyver ha scritto: > With a list, yes. With a numpy array, which is probably as relevant for > many rpy2 users, adding an integer adds it to every element: That was actually the reason I expected it to work. However it's not a huge issue to use .ro

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Thomas Kluyver
On 21 March 2013 14:28, Laurent Gautier wrote: > In Python this is an error. > >>> x+3 > Traceback (most recent call last): > File "", line 1, in > TypeError: can only concatenate list (not "int") to list > With a list, yes. With a numpy array, which is probably as relevant for many rpy2 user

Re: [Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Laurent Gautier
On 2013-03-21 02:59, Luca Beltrame wrote: This occurs with the latest 2.3. Example case: robjects.IntVector([0,1,2]) + 1 This is what it returns [ 0,1,2,1] While I'd expect, like in R c(0,1,2) + 1 [1] 1 2 3 Is this a bug, or do I have to do things differentl

[Rpy] Addition to R vectors not behaving as expected (as in R)

2013-03-21 Thread Luca Beltrame
This occurs with the latest 2.3. Example case: robjects.IntVector([0,1,2]) + 1 This is what it returns [ 0,1,2,1] While I'd expect, like in R > c(0,1,2) + 1 [1] 1 2 3 Is this a bug, or do I have to do things differently? -- Luca Beltrame, Ph.D. - Translational