[R-SIG-Mac] If you're well and truly bored you might want to play with this...

Byron Ellis bellis at hsph.harvard.edu
Thu Mar 27 04:28:08 MET 2003


Hi folks, as I was recently stuck on a plane from Boston to LA I 
finally got started coding a Mathematica/Maple-style notebook interface 
for R... I made several abortive attempts on the Windows platform and 
finally got a technology test working under Cocoa during the flight 
(and the last couple of days).  You can play with a copy here: 
http://www.people.fas.harvard.edu/~bcellis/StatPaper.app.tar.gz

Mostly it serves me as a cool toy that makes relatively deep use of the 
Cocoa APIs. It also helps me think about using R as a "kernel." Like, 
what happens when I have two documents? How do I get graphics out 
without having to resort to an intermediate file? (Oh how I wish 
devices could take a connection... then I could just pipe the PDF 
output directly to an NSImage and be done with it... but I should 
probably find a less hackish solution. Suggestions willing accepted :-))

Just decompress it. And it should run fine (at least it did under 
10.2.4 :-))
As its a tech test is comes with a set of caveats as long as my arm 
(including, but not limited to):
	* Assumes you have R installed in the usual place (/usr/local/lib/R). 
I'm using Jan's build of 1.6.2. It doesn't embed or anything (it 
employs --slave, sort of) so as long as you can execute R it should 
actually load the engine. There will be approximately 0 helpful error 
messages if it doesn't load.
	* You can't save or load documents
	* Opening a second document might cause your computer to explode. It 
will definitely cause strange things to happen
	  as it only uses a single (global) R session for computation. I'm not 
sure how to work around this.
	* You can only execute the entire document at once. The code to 
execute a single block is pretty trivial, I just haven't hooked it up 
to the WindowController
             yet
	* trying to use graphics will probably result in horrific explosions. 
Obviously inline graphics are a high priority, but as mentioned above, 
I'm not sure how it would be done.
	* I'm not particularly fond of the name... but the project had to be 
called -something-.
	* Its a tech test, I'd be more surprised if it works than if it 
doesn't :-)

Just sort of tossing it out there since there seems to be a good deal 
of GUI development focused on more abstract Stata/Spreadsheet-like 
interfaces rather than more document-like interfaces. At the very least 
its the beginning of a nearly WYSIWYG vignette editor :-)

Enjoy

Byron Ellis (bellis at hsph.harvard.edu)
"Oook" - The Librarian



More information about the R-SIG-Mac mailing list