What is the best interface from Python 3.1.1 to R?

陌路散爱 提交于 2019-12-12 08:23:18

问题


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.


回答1:


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).




回答2:


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/




回答3:


I don't believe there are any available options for Python 3.1.1.

The current status of R-Python bindings:

At the moment, three options: RPy, RPy2, and RSPython.

RPy and RPy2 were developed and are maintained by the same team of developers; RPy2 is a substantial rewrite of RPy (which in turn is based on Omega hat's RSPython).

RPy is still actively maintained.

RSPython is still available but i believe is no longer actively developed. I looked a couple of months ago and the latest version i could find (0.7-1) was released in October 2006.

The most current stable version as well as the dev version (2.1 rc) of RPy2 is optimized for R version 2.10 (current stable version) and Python version 2.6 (ie, those are the versions used in development). I am not aware of any announcement by the RPy2 developers to support Python versions 3.x.



来源:https://stackoverflow.com/questions/2573132/what-is-the-best-interface-from-python-3-1-1-to-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!