Subject: Accessing maxima from the R statistical program
From: Robert Dodier
Date: Wed, 22 Nov 2006 21:21:38 -0700
Hello S?ren,
Combining R with Maxima has come up more than once before.
We are big fans of R (some of us, anyway), and since R and Maxima
both rock, R + Maxima would rock nearly as hard as Tenacious D.
(Tenacious D is a comedy act which sings parodies of heavy metal.)
In fact recently some new add-on packages for Maxima have
been created (thanks to Mario Rodriguez) for statistical functions.
So Maxima is slowly inching into towards R's capabilities,
by reimplementing them.
> Specifically what we need is a way of accessing maxima
> programatically from within R. In the Ryacas package this is done by
> communicating with yacas via telnet to a specific port. Perhaps
> maxima could (easily?) be made so that this would also be possible
> for maxima? Perhaps (even better) it would be possible to write
> some api-functions via which maxima can be accessed?
A socket interface has been implemented for various GUI projects.
See: http://maxima.sourceforge.net/relatedprojects.shtml
A difficulty there is that Maxima assumes that there
there is a console and there is always someone (human) there,
to answer questions. So Maxima doesn't always operate in a strict
one-input, one-output mode. But all of the GUI projects manage to
cope in some way.
As for a programmatic interface, that could be implemented via
Lisp FFI (foreign function interface). Most Lisp implementations
have their own FFI, but there is not one FFI which works for all Lisps.
CFFI, for example, works for several Lisps but not GCL.
Maybe that is good enough for your purposes.
R has at least three strong points compared to Maxima --
better plots and plotting functions, more extensive data i/o functions,
and lots and lots of add-on packages. We are currently adding to the
numerical capabilities of Maxima so we're catching up there.
It would be straightforward to implement similar data i/o functions
so we'll probably do that too. Not sure what's possible in the way
of plotting.
The R add-on packages would be extremely valuable to have in
Maxima. Since R is (almost) entirely numerical, it may be possible
to automatically translate R scripts to Maxima scripts. Just a thought.
Thanks for your interest in Maxima, & hope this helps.
Robert Dodier