Database Reference
In-Depth Information
How it works…
The key here is to use the Mathematica keyword
Function
in order to create the function
and return it. We assigned this to
factor-int
, and from that point onwards, we can treat the
value as a regular function value.
Setting up R to talk to Clojure
Another major statistical processing environment is R. It's an open source programming
language and environment designed for statistical analysis. It's widely used and has an
active community as well as a huge and growing body of useful add-on packages.
While there's no Clojure-speciic interoperability library, there is one for Java, and we can
use that to pass calls to R and to get results back. In this recipe, we'll set this system up.
Getting ready
by following the link to CRAN, picking a mirror, and downloading the correct version of R for
our platform.
and install the libraries to access R.
How to do it…
There are two parts to setting up this system. We'll get the R-side working, and then we'll see
what Clojure needs to have in place.
Setting up R
To set up the system, we irst have to conigure R to talk to Clojure:
1.
Once R is installed, we'll download the interoperability package,
Rserve
. In my
Rserver_1.88-1.tar.gz
, but you might have a more recent version available.
2.
You'll need to extract the iles from the tarball that you've downloaded. On Windows,
$ tar xfzv Rserve_1.88-1.tar.gz
x Rserve/
x Rserve/configure.win
x Rserve/cleanup
…