本文介绍了Rpy2,pyrserve和PypeR如何比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从Python程序中访问R.我知道Rpy2,pyrserve和PypeR.
I would like to access R from within a Python program. I am aware of Rpy2, pyrserve and PypeR.
这三种选择的优缺点是什么?
What are the advantages or disadvantages of these three options?
推荐答案
我比其他人更了解3种,但是按问题中给出的顺序:
I know one of the 3 better than the others, but in the order given in the question:
rpy2:
- Python和R之间的C级接口(R作为嵌入式进程运行)
- 暴露给Python的R对象,无需复制数据
- 相反,Python的numpy数组可以暴露给R而无需复制
- 低级接口(靠近R C-API)和高级接口(为方便起见)
- 可以对向量和数组进行就地修改
- R回调函数可以在Python中实现
- 可能具有带有Python标签的匿名R对象
- 可以进行Python酸洗
- 使用其控制台完全自定义R的行为(以便实现完整的R GUI)
- 支持有限的MSWindows
- C-level interface between Python and R (R running as an embedded process)
- R objects exposed to Python without the need to copy the data over
- Conversely, Python's numpy arrays can be exposed to R without making a copy
- Low-level interface (close to the R C-API) and high-level interface (for convenience)
- In-place modification for vectors and arrays possible
- R callback functions can be implemented in Python
- Possible to have anonymous R objects with a Python label
- Python pickling possible
- Full customization of R's behavior with its console (so possible to implement a full R GUI)
- MSWindows with limited support
pyrserve:
- 原生Python代码(将/应该/可与CPython,Jython,IronPython一起使用)
- 使用R's Rserve
- 与远程计算和RServe相关的优点和不便之处
佩珀:
- 原生Python代码(将/应该/可与CPython,Jython,IronPython一起使用)
- 使用管道使Python与R通信(具有与之相关的优点和不便之处)
Windows对rpy2的支持
edit: Windows support for rpy2
这篇关于Rpy2,pyrserve和PypeR如何比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!