Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best interface from Python 3.1.1 to R?

I am using Python 3.1.1 on Mac OS X 10.6.2 and need an interface to R. When browsing the internet I found out about RPy. Is this the right choice?

Currently, a program in Python computes a distance matrix and, stores it in a file. I invoke R separately in an interactive way and read in the matrix for cluster analysis. In order to simplify computation one could prepare a script file for R then call it from Python and read back the results. Since I am new to Python, I would not like to go back to 2.6.

like image 512
Tomaž Pisanski Avatar asked Apr 04 '10 00:04

Tomaž Pisanski


2 Answers

edit: Rewrite to summarize the edits that accumulated over time.

The current rpy2 release (2.3.x series) has full support for Python 3.3, while no claim is made about Python 3.0, 3.1, or 3.2. At the time of writing the next rpy2 release (under development, 2.4.x series) is only supporting Python 3.3.

History of Python 3 support:

  • rpy2-2.1.0-dev / Python 3 branch in the repository - experimental support and application for a Google Summer of Code project consisting in porting rpy2 to Python 3 (under the Python umbrella)

  • application was accepted and thanks to Google's funding support for Python 3 slowly got into the main codebase (there was a fair bit of work still to be done after the GSoC - it made it for branch version_2.2.x).

like image 87
lgautier Avatar answered Nov 06 '22 19:11

lgautier


PypeR it's an option if you're trying to use R with recent versions of Python (like 3.1)

More info at:

http://rinpy.sourceforge.net/

like image 4
Michael Avatar answered Nov 06 '22 20:11

Michael