Re: [Rpy] rpy2 compile on windows

2009-01-15 Thread James Yoo
Laurent, Thank you very much for all the pointers and such... finally got everything compiled and installed. what a pain it is to use windows sometimes. thanks again, James On Wed, Jan 14, 2009 at 2:49 PM, Laurent Gautier wrote: > > That's a bug in distutils on Windows. > > See > http://www.

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Laurent Gautier
Simone Gabbriellini wrote: > Dear List, > > sorry, but it's me again, because I still cannot figure out how to do > this thing... > > I have my matrix in R as a numpy.array, everything is ok: > > In [35]: mymatrixR > Out[35]: > > now I want to put mymatrixR inside the R object QAP, something l

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Simone Gabbriellini
Dear List, sorry, but it's me again, because I still cannot figure out how to do this thing... I have my matrix in R as a numpy.array, everything is ok: In [35]: mymatrixR Out[35]: now I want to put mymatrixR inside the R object QAP, something like QAPset[,,1]<-mymatrixR if I simply do: rob

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Simone Gabbriellini
You are right, I was doing a bad conversion of the matrix to the numpy.array... in fact the result of what you ask was: Out[56]: () now everything works because I do: mymatrixN = numpy.array(list(mymatrix)) and now if I run numpy.shape I have: Out[56]: (50,50) I got the hint from the author of

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Simone Gabbriellini
... if I convert the matrix into array I have this new error: In [41]: mymatrixR = ro.conversion.py2ri(mymatrixNARRAY) --- TypeError Traceback (most recent call last) /Users/ogabbrie/Deskto

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Oliver Tomic
The conversion doesn't work for me with matrices either, but the output is different on my machine. This is what I get: [code START] >>> import numpy >>> b = [[1,2,3],[4,5,6]] >>>bb = numpy.matrix(b) >>> bb matrix([[1, 2, 3], [4, 5, 6]]) >>> import rpy2.robjects as ro >>> import rpy2

Re: [Rpy] how to pass a python object to R

2009-01-15 Thread Simone Gabbriellini
Hi Oliver, yes this helps very much... anyway, this works with array or also with matrix? I ask this because I have a matrix 50x50, and if I do: mymatrixNump = numpy.matrix(mymatrix) mymatrixR = ro.conversion.py2ri(mymatrixNump) I have: --