Database Reference
In-Depth Information
R ( http://www.r-project.org/ ) is also another such tool. It's an open source system
that specializes in statistical computing. It's also a programming language, and thanks to an
active user community, there are a lot of contributed packages for almost any statistical task.
Both these systems are powerful and complex in their own right, and we won't be able to
go into details of how to use them or their features in this chapter. However, if you already
have some analyses implemented in either Mathematica or R or you want to learn one of
these and you wish to incorporate them into a Clojure-driven worklow, this chapter should
show you the way.
Unfortunately, interoperability—interfacing directly between different computer systems,
such as Clojure and Mathematica or R—is a dificult and often tricky task. We can fall back
on shufling data back and forth using CSV iles, but for more power and lexibility, having a
direct connection between the two systems is unmatched, and it's often worth the effort and
frustration in order to have a more direct and richer interface. In this chapter, we'll talk about
how to set up this interoperability and how to use each system from Clojure to do
simple tasks.
Setting up Mathematica to talk to
Clojuratica for Mac OS X and Linux
Before we start interfacing with Mathematica, we have to download the libraries and set up
our system to do so. This is a little complicated. We'll need to download the library in order to
handle the interoperability and move a few iles around.
Part of what makes this task so dificult is that several things vary, depending on your
operating system. Moreover, in order to work with Leiningen, this recipe uses some features
of the underlying operating system that aren't available for Windows (symbolic links), so this
recipe won't work for the Windows platform. However, Windows users can refer to the next
recipe, Setting up Mathematica to talk to Clojuratica for Windows .
Getting ready
We'll need to have Mathematica installed. You can get an evaluation copy from
http://www.wolfram.com/mathematica/trial/ , but if you're looking at this recipe,
you probably already have it and are just looking for a way to connect to it from Clojure.
You'll also need to have Ant ( http://ant.apache.org/ ) and Maven ( http://maven.
apache.org/ ) installed. These are Java development tools that are used to build and install
the libraries in order to access Mathematica.
 
Search WWH ::




Custom Search