This package allows the user to call Python from R (technically, Jython; see below). The shipped version of Jython is 2.5.1, compatible with the same Python version.
rJython is intended for running Python code from R. R programs and packages can:
Here is a sample session with rJython:
Mainly, users and package developers who want to use functionalities available in Python but not in R.
There are many modules in Python which could easily extend R functionality if there would be a way to call Python code from R.
rpy and rpy2, a redesign and rewrite of rpy, are Python interfaces to R. They allow users to call R from Python.
rJython provides the opposite interface.
Besides, no code from rpy/rpy2 has been used in the development of rJython.
rJython, being based on Jython, interfaces Python via Java. Therefore, it depends on package rJava. However, it proves an alternative interface. Only advanced users might be interested on making their own calls to Python via Java directly using rJava rather than using the standard interface provided by the package.
One of the most daunting tasks in building an interface between two languages is provide mechanisms for exchanging different data structures between them. rJython uses json:
This simple mechanism allow R and Python exchange relatively complex data structures with ease.
In summary: pure Python modules can be used in Jython; modules including C code, cannot.Yes. Jython is an implementation of the Python language for the Java platform. Jython 2.5 implements the same language as CPython 2.5, and nearly all of the Core Python standard library modules. (CPython is the C implementation of the Python language.) Jython 2.5 uses the same regression test suite as CPython, with some minor modifications.
There are a number of differences. First, Jython programs cannot use CPython extension modules written in C. These modules usually have files with the extension .so, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java. Although it is technically feasible to support such extensions - IronPython does so - there are no plans to do so in Jython.
There are a number of other differences between the two implementations that are unlikely to go away. These range from the trivial - Jython's code objects currently do not have a co_code attribute because it is not possible to directly access Java bytecode from a class, without loading the file; to the significant - Jython uses Java's true garbage collection rather than Python's reference counting scheme.
The project summary page can be found here. You may also be interested in its page at crantastic.
The package was originally developed by G. Grothendieck and Carlos J. Gil Bellosta. It uses Jython, that is distributed along with the package, and Python's simplejson module.