[TxMt] For all R users: a R daemon running 'inside' of TM (second trial)

Hans-Jörg Bibiko bibiko at eva.mpg.de
Wed Dec 12 19:19:49 UTC 2007


Hi,

OK. Step by step.

First we have to test the Rdaemon whether it really works stable.  
Thus, please test it against large R projects! [But be careful, do  
not use critical data]

The only known pitfalls are:
-fix() and edit() don't work (it only opens a TM window)
-a<-readline("test") works but one has to enter the value in a  
separate line (up to now)
-quartz() only works if one has installed the CarbonEL package

Installation:
-install R daemon.tmbundle
-open the gear menu (CTRL+ESC) for R daemon and invoke the last item  
'Install Rdaemon'

That's it.

General stuff:
-R daemon listens at $HOME/Rdaemon/r_in
-the entire session is written into $HOME/Rdaemon/r_out
-the result of selected commands or if you run your commands in the  
background will be written into $HOME/Rdaemon/r_res
-errors/messages will be written into $HOME/Rdaemon/r_err
-there is a persistent history for Rdaemon (OPT+ARROWUP/DOWN or a  
list CTRL+OPT+ARROWUP)
-working directory for the Rdaemon is $HOME/Rdaemon/
-r_out, r_err will be overwritten if you start Rdaemon

Workflow: [a dilettante made screencast is here http://www.bibiko.de/ 
Rsession2.mov (sorry 20MB) ]
-open a new document and set language to 'R console'
-type 'start' and press TAB to start the daemon
-wait a bit until '> ' occurs
-type whatever you want and execute the line or selection by pressing  
NUMPAD+ENTER
-to quit type 'q("yes")' or 'q("no")' + NUMPAD+ENTER (.Rdata will be  
written into $HOME/Rdaemon; if you don't quit R but you quit TM, R  
daemon runs further, so you can start TM again and continue your stuff)
-there is a basic TM project called Rsession available which I  
recommend to use to simplify some things


In addition to that I tried to write a kind of a GUI around it. You  
can invoke the R commander with CTRL+OPT+APPLE+R.
This R commander is only a PROTOTYPE!!
The idea is to use an ordinary HTML output window of a tmCommand to  
remote the entire Rdaemon session. If the GUI works in the daily life  
a very nice side-effect could arise. You have a quite simple to  
modify GUI. It's written in basic HTML/JavaScript plus a bit shell  
commands. In other words everyone could set up her/his frequent used  
R commands in order to save time. AND the possibilities of that GUI  
are almost endless if one has time to write code ;) [and I have  
dozens of ideas]
BTW, the intent of this GUI is NOT to replace the wonderful R.app!

I played with Rdaemon and the GUI. I ran several scripts etc. and it  
turned out that if one has understood the workflow once one can do a  
lot of stuff faster and one is more flexible (at least up to now ;).

OK. But we have to attest firstly whether Rdaemon runs stable!

I would be very appreciate if someone can test it. Any hint -  
illogical behaviour, crashes, handling stuff, speed, etc. - is highly  
welcomed.

--Hans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: R daemon.tmbundle.zip
Type: application/zip
Size: 130501 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20071212/1f540cb3/attachment.zip>


More information about the textmate mailing list