我有以下两行代码,它们在 R 和 Python 中都运行良好(通过 Rpy):
[R] rcut = cut(vector, brks)
[Python] rcut = r.cut(vector, brks)
但是,如果我想添加 的参数include.lowest=TRUE
,它会在 R 中按预期运行:
[R] rcut = cut(vector, brks, include.lowest=TRUE)
但它在 Rpy 中不起作用:
[Python] rcut = r.cut(vector, brks, include_lowest="TRUE")
这给出了以下错误:
rpy.RPy_RException: Error in ok && include.lowest : invalid 'y' type in 'x && y'
你知道是什么原因造成的,我应该怎么做才能让它发挥作用?谢谢!