R/SPlus - Python Interface

Recent release: RSPython_0.7-1.tar.gz

Currently, this interfaces allows This allows Python programmers unfamiliar with the syntax of R to easily use its functionality and vice versa. It also allows data to be manipulated using Pythons tools and then passed to R's rich graphical and statistical tools.

It boasts a very rich and general, yet easy to use mechanism for transferring objects from R to Python and vice versa. It uses the concept of a foreign reference or a pointer to avoid transferring data and performing conversions that don't make sense. Additionally, it allows users of each language to register functions written in that language to perform the conversion of objects in the other language. See Conversion Examples for more information. (The code for using R functions to perform the conversion will be in the next release.)

Additionally it provides reflectance information to allow users to discover information about the modules/packages, functions and methods offered by the other system. This allows one to automate certain tasks and make the computations appear to be local. This also allows for substituting different implementations of that functionality, including using other inter-system interfaces such as Java, Perl, CORBA, etc.


Simple examples of this interface can be seen in call.py.

The following are some very early efforts to provide documentation for aspects of the package. ( In general, the author of the package will not write documentation as clearly as the users. Please note that these are not intended to be the final version. Any help in writing the documents, providing examples, etc. would be very much appreciated.)

  • Calling R from Python
  • Calling Python from R
  • Converters and Functions
    Details about using Python functions as converters for R objects and the general philosophy of the interface and foreign references.
  • Help Pages HTML
  • Download


    There is a tarball containing the code and configuration mechanism. It is intended to be installed as an R package, i.e.
      R CMD INSTALL -c RSPython_0.7-1.tar.gz

    Windows Binary

    A binary version of this package compiled for Windows for use with version R-1.4.0 is also available. To install, simply unzip this file from within the $R_HOME/library directory. This was compiled using Python2.2.

    NOTE: this currently does not allow one to embedd R within Python on Windows.

    Related Packages

    This is just one in a collection of inter-system interfaces that illustrate the general mechanism we have developed to connect programming languages and applications. The others include with more on the way.
    Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Tue Nov 29 16:53:01 PST 2005