Re: [Rpy] R console

2009-02-22 Thread Nathaniel Smith
On Sun, Feb 22, 2009 at 5:19 AM, Carson J.Q. Farmer wrote: > Now using Rpy2, I am having trouble reproducing this functionality. I > have used rinterface.setWriteConsole() to catch the console output, but > this does not appear to be all console output, as I get (for example) > messages from packa

Re: [Rpy] matrix updating using rpy2

2009-02-22 Thread Laurent Gautier
And I forget one thing: computing the 1-D index from the row and column is also straightforward. # --- import rpy2.robjects as ro row_i = 1 col_i = 2 idx = (row_i-1) + m.dim[0] * (col_i - 1) m = ro.r.matrix(ro.IntVector(range(9)), nrow=3, ncol=3) m[idx] = 33 print(m) # --- L. Laurent

Re: [Rpy] R console

2009-02-22 Thread Laurent Gautier
Carson J.Q. Farmer wrote: > Hi list, > > I have written a simple python application, and I would like to have an > R console embedded within it. For simplicity sake, this is essentially a > text box which receives user input (R commands), and an text browser > (read only) for the R output. Usi

[Rpy] R console

2009-02-22 Thread Carson J.Q. Farmer
Hi list, I have written a simple python application, and I would like to have an R console embedded within it. For simplicity sake, this is essentially a text box which receives user input (R commands), and an text browser (read only) for the R output. Using Rpy this was relatively simple, tho

Re: [Rpy] matrix updating using rpy2

2009-02-22 Thread Laurent Gautier
The code snippet I gave was incorrect: # --- import rpy2.robjects as ro import rpy2.rlike.container as rlc m = ro.r.matrix(range(9), nrow=3, ncol=3) print(m) idx = rlc.TaggedList([ro.IntVector([1, ]), ro.IntVector([2, ])]) m2 = m.assign(idx, 33) print(m2) idx = rlc.Tagged