Skip to content
Prev 112 / 1236 Next

[R-gui] Interfaces between GUIs and R

On Friday, April 4, 2003, at 04:31 AM, Philippe Grosjean wrote:

            
Ah, slick :-)
Well, the nice thing about OpenMath is the namespacing (Content 
Dictionaries) let you specify pretty much any structure you like so it 
would be possible to completely serialize any R type using OpenMath in 
a straightforward manner. So (to steal of pseudo-Mathematica for a 
moment)
x <- function(a,b) { a + b }

R:Assign[Var(x),R:Function[{Var(a),Var(b)},{R:Sum[Var(a),Var(b)]}]]

Whether or not we'd WANT to do this is up for grabs :-) My intent is 
to, essentially, implement the equivalent of "Enter" from Mathematica 
(for entering lines of code) initially as well as the code necessary to 
transport graphics data across the link in a "display list" of some 
sort (or at the very least as a set of OpenMath functions). I'd rather 
have something simple that works at first rather than something complex 
that never gets finished ;-)
I have a *very* primitive OpenMath package for R that allows two R 
instances to talk to each other at the moment (via UNIX and TCP 
sockets). It can pass the primitives as well as Objects (lists with a 
class attribute basically) and Applications (also a list, different 
class attribute). It seems like this might eventually be a job for 
REventLoop, but I haven't yet fathomed how to do away with stdin/stdout 
entirely (since this I/O mechanism is message based, not data stream 
based stdin/stdout type interfaces don't have much meaning... though I 
would *like* Enter[Some Text] to simulate entering a line for managing 
block generation (each output generating statement generates a new 
block of text) and error reporting as its oh-so-much-more-useful to 
have a "syntax error" attached to a particular line rather than an 
arbitrarily large hunk of code).

There isn't any documentation at all and little error handling, but 
since you're interested I can start making that package available 
through some mechanism relatively soon (I should really get this stuff 
into a SourceForge project or something similar). The "StatPaper" side 
of things is all ObjectiveC based and actually already supports the 
notion of an "evaluator" where objects are set to handle a particular 
namespace (for instance, there is a class that handles the "Plot" 
namespace for mapping a prospective stream of ObjectMath data back into 
an image representation, a PDF in this case, which is based on 
devQuartz... though with different handling for font metrics and such)
Byron Ellis (bellis@hsph.harvard.edu)
"Oook" - The Librarian