1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
JRI - Java/R Interface
------------------------
Copyright (C) 2006 Simon Urbanek <simon.urbanek@r-project.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details (LGPL.txt).
This package contains code that is necessary to run
R as a single thread of a Java application. It provides
callback that make it possible to run R in REPL mode
thus giving the Java application full access to the
console.
Currently the API is very, very low-level, comparable
to the C level interface to R. Convenience methods for
mid to high-level are planned, but not implemented yet.
For R-to-Java interface, use rJava package which
integrates fine with JRI. rJava hooks into the same
JVM, so both are opertaing in the same environment.
Java to R: JRI
R to Java: rJava
How to compile
----------------
As of JRI 0.2 everything is 'autoconf'igured.
1) Make sure JDK 1.4 or higher is installed (on Linux
1.5 or later must be installed) and all java
commands are ont the PATH. Alternatively you can
set JAVA_HOME instead.
2) ./configure
3) make
On Windows run "sh configure.win" instead of configure
Note for Windows users: you will need the same tools
that are necessary to build R, i.e. the /bin tools
and MinGW. See R for details.
How to use JRI
----------------
There are two Java examples in the JRI directory:
rtest.java - demonstrates the use of the low-level
interface to construct and retrieve
complex R objects. It also demonstrates
how to setup callbacks for handling of
the console.
rtest2.java - a very simple console using stdin as input
and a TextField for output.
The examples can be run with
./run rtest
./run rtest2
On Windows use run.bat instead
---
04/2006 Simon Urbanek
|