Questions tagged «rpy2»

7
如何创建一个空的R向量以添加新项目
我想在Rpy2模块提供的Python中使用R。我注意到R具有非常方便的[]操作,您可以通过该操作提取特定的列或行。如何通过Python脚本实现这样的功能? 我的想法是创建一个R向量并将这些需要的元素添加到该向量中,以便最终向量与R中的向量相同。我创建了一个seq(),但似乎它的起始数字为1,因此最终结果将始终为从数字1开始,这不是我想要的。那么,有没有更好的方法可以做到这一点?
92 python  r  vector  rpy2 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.