[Rpy] Making dataframes ... fast

2009-09-28 Thread Gary Strangman
Hi all, I have a python list of lists (each sublist is a row of data), plus a list of column names. Something like this ... >>> d = [['S80', 'C', 137.5, 0], ['S82', 'C', 155.1, 1], ['S83', 'T', 11.96, 0], ['S84', 'T', 47,1]] ['S85', 'T', numpy.nan, 1]

Re: [Rpy] Why rpy.r.t is not working

2009-09-28 Thread Peng Yu
>>> import rpy >>> >>> rpy.set_default_mode(rpy.NO_CONVERSION) >>> >>> x = [ [1, 2, 3], [1, 2, 3] ] >>> y = rpy.r.t(x) >>> y.as_py(rpy.BASIC_CONVERSION) [[1, 2, 3], [1, 2, 3]] >>> I want to transpose x in the above code. But it does not do so. How should I fix it? Regards, Peng On Mon, Sep 28,

[Rpy] Fwd: [Numpy-discussion] setup.py does not use the correct library

2009-09-28 Thread Peng Yu
On Mon, Sep 28, 2009 at 4:44 PM, Robert Kern wrote: > On Mon, Sep 28, 2009 at 16:40, Peng Yu wrote: >> I attached the script that I run for build and the build output. I >> think that setup.py doesn't use the correct python library. But I'm >> not sure why. Would you please help me figure out wha

[Rpy] Why I can not plot a matrix?

2009-09-28 Thread Peng Yu
Hi, In R, I can plot a 2 column matrix > x=1:3 > y=1:3 > plot(x,y) > plot(cbind(x,y)) But I'm wondering why I can not do so with rpy. In the following python code, the last line does not work. Can somebody let me know why? import rpy x = [1, 2, 3] y = [1, 2, 3] rpy.r.plot(x, y) l = [ [1, 2, 3]

Re: [Rpy] Why rpy.r.t is not working

2009-09-28 Thread Warnes, Gregory R.
The problem is that the R object returned from "rpy.r.matrix(range(6),nr=2)" is being automatically converted to a python object before being passed to the transpose function. The easiest solution is to turn off automatic conversion, and then manually ask for conversion when you want it: >>> impo

Re: [Rpy] rpy2 error when loading 'oligo?

2009-09-28 Thread Laurent Gautier
"oligo" is loading fine from rpy2 here. - What OS are you using ? (from the paths in the error message that's an UNIX-like, but more details is sometimes helpful) - Do you have several versions of R installed on your system ? (and rpy2 somehow calling a different one from the one you get when w