On May 1, 2006, at 6:55 PM, Peter Cowan wrote:
- (Ideally, via a plugin probably) Be able to have a "session" with
R, i.e. type commands and have their result appear. Each pressing of "return" should execute the current line in a running version of R, and insert the output on the next line.
This shouldn't be too difficult, there is a shell command for running R code. R CMD BATCH.
Well, you do need to somehow keep it running in the background and interact with it. I haven't been able to do that in a nice way. I think R CMD BATCH might be more closely to what i am talking about in question 1. Problem is, I found no way to tell it to output the information to standard output instead of another file, unless I've missed something. See, what I want is to have R execute each command and return me the output so that I can start showing it, instead of running the entire program and then showing all the output. Exactly what happens with tmruby.
I'm not too savvy with writing commands yet, but perhaps R --slave can do what you want. It writes to standard output. Every time it is called might be a new instance of R though, which would be problematic for evaluating previously assigned function etc. I also don't know how it handles figures.
Peter