Hi all,
Can the Rdaemon bundle can behave in a way that's similar to ESS in Emacs (or as near as possible given that TextMate doesn't do split windows and frames, etc). What I want is to have an R file open in one window (associated with the R bundle) and an R session created under Rdaemon open in a second window. I write R code in the R file and, as needed, send chunks of it over to the R session where they are executed. This is the standard way of working interactively with R in Emacs/ESS. You can select code chunks and execute them in an R process running inside a buffer. The code is echoed in the R session when you send it over, together with any errors or output, etc.
In TextMate, I can have an R file open and an R session running in Rdaemon, which is great. I can select code and use "Send Selection to Rdaemon", but it works in the background (or rather, with a progress- meter message box). The code executes properly, but it and its output are not echoed in the open Rdaemon window. Once the code has been executed I can step back through the code in the Rdaemon window using the line-by-line code history. But what I want is to see code chunks (and their output) inside the Rdaemon window as I go. Is this possible?
I realize it's somewhat unfair to ask TM/Rdaemon to behave just like Emacs/ESS and yet still be TM. It's just that now that TM's LaTeX bundle is so solid, having Rdaemon able to behave in this way would mean I could stop using Emacs ...
Thanks,
Kieran
On 29.03.2009, at 04:52, Kieran Healy wrote:
Can the Rdaemon bundle can behave in a way that's similar to ESS in Emacs (or as near as possible given that TextMate doesn't do split windows and frames, etc). What I want is to have an R file open in one window (associated with the R bundle) and an R session created under Rdaemon open in a second window. I write R code in the R file and, as needed, send chunks of it over to the R session where they are executed. [...] The code is echoed in the R session when you send it over, together with any errors or output, etc.
In TextMate, I can have an R file open and an R session running in Rdaemon, which is great. I can select code and use "Send Selection to Rdaemon", but it works in the background (or rather, with a progress- meter message box). The code executes properly, but it and its output are not echoed in the open Rdaemon window. [...] But what I want is to see code chunks (and their output) inside the Rdaemon window as I go. Is this possible?
Hmm, the main issue here is that the output of the R session is not bound to any specific TM window ('only' to the current one). This is an advantage, I can run R code also from other docs like from a TeX file; but has also its disadvantages.
If I would bind the output of the R session to one window then one would have the problem how to update/reach that window (it would be possible but ...)
I'm using very often your mentioned workaround, two windows, for developing a function for instance. Then I send the function to the Rdaemon, switch to the Rdaemon window, and try it out. If an error occurred in that code sent a new window would be opened mentioning the error code.
On the other hand one should ask why one needs the behaviour you mentioned. One can do this also in a doc associated to Rdaemon. Remember the Rdaemon doc is NOT a time-linear console, it's still an editor window, thus you can run code, go some lines back, run an other command, press ⌘Z for undo, correct the command, delete unused stuff, etc. In other words why are you using two windows? See: http://www.bibiko.de/TM_R_ex01.mov as naïve example.
OK. This workaround is totally different from the 'normal' R console, but since I'm using it all the time I have really problems to use R.app or the Terminal because I miss this flexibility.
Nevertheless I'll try to find a workaround similar to that one you mentioned.
--Hans