I have the following two lines of code that both run fine in both R and Python (via Rpy):
[R] rcut = cut(vector, brks)
[Python] rcut = r.cut(vector, brks)
However, if I want to add the argument of include.lowest=TRUE, it runs as expected in R:
[R] rcut = cut(vector, brks, include.lowest=TRUE)
But it doesn’t work in Rpy:
[Python] rcut = r.cut(vector, brks, include_lowest="TRUE")
which gives the following error:
rpy.RPy_RException: Error in ok && include.lowest : invalid 'y' type in 'x && y'
Do you know what might cause that and what should I do to make it work? Thx!
I don’t know
rpy, but could it be due to using"TRUE"(a character) instead ofTRUE(a logical)?EDIT: The
rpydocumentation seems to indicate usingr.TRUE:http://rpy.sourceforge.net/rpy/doc/rpy_html/R-boolean-objects.html#R-boolean-objects