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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我比其他人更了解这三个中的一个,但按照问题中给出的顺序:
rpy2:
Pyrserve:
pyper:
编辑: Windows 对 rpy2 的支持
I know one of the 3 better than the others, but in the order given in the question:
rpy2:
pyrserve:
pyper:
edit: Windows support for rpy2
来自PypeR 统计软件杂志中的论文:
From the paper in the Journal of Statistical Software on PypeR:
从开发人员的角度来看,我们过去使用 rpy/rpy2 为基于 Python 的应用程序提供统计和绘图功能。它在交付我们的应用程序时造成了巨大的问题,因为 rpy/rpy2 需要针对 Python 和 R 的特定组合进行编译,这使得我们无法提供开箱即用的二进制发行版,除非我们也捆绑 R。由于 rpy/rpy2 并不是特别容易安装,因此我们最终将相关部分替换为原生 Python 模块(例如 matplotlib)。如果我们必须使用 R,我们会切换到 Pyrserve,因为我们可以在本地启动 R 服务器并连接到它,而不必担心 R 的版本。
From a developer's prospective, we used to use rpy/rpy2 to provide statistical and drawing functions to our Python-based application. It has caused huge problems in delivering our application because rpy/rpy2 needs to be compiled for specific combinations of Python and R, which makes it infeasible for us to provide binary distributions that work out of box unless we bundle R as well. Because rpy/rpy2 are not particularly easy to install, we ended up replacing relevant parts with native Python modules such as matplotlib. We would have switched to pyrserve if we had to use R because we could start a R server locally and connect to it without worrying about the version of R.
在pyper中,我无法使用assign()将大矩阵从python传递到r实例。不过,我对 rpy2 没有任何问题。
这只是我的经验。
in pyper, i can't pass large matrix from python to r instance with assign(). however, i don't have issue with rpy2.
it is just my experience.