Reputation: 4930
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!
Upvotes: 1
Views: 857
Reputation: 176648
I don't know rpy
, but could it be due to using "TRUE"
(a character) instead of TRUE
(a logical)?
EDIT: The rpy
documentation seems to indicate using r.TRUE
:
http://rpy.sourceforge.net/rpy/doc/rpy_html/R-boolean-objects.html#R-boolean-objects
Upvotes: 5
Reputation: 284602
I know nothing about Rpy, but I would guess it needs to be include_lowest=True
(No quotes, True
is a boolean value in python.)
Upvotes: 1