Hi, It took me a bit of time to track this down but the on my system (Mac os X 10.6 with python 2.6.1) some integers are passed as long. This fails in the riterface conversion. To fix this I simply modified init.py in robjects folder and added the following line within the default_py2ri function:
elif isinstance(o, long):
res = rinterface.SexpVector([o, ], rinterface.INTSXP)
Thanks,
Yair
Anonymous
Thanks.
The branches 2.0.x and 2.1.x have now both the fix included
(so it will be in releases 2.0.8, and 2.1.0)
The final bugfix looking will is looking like follows:
elif isinstance(o, int) or isinstance(o, long):
res = rinterface.SexpVector([o, ], rinterface.INTSXP)
(I also noted that explicit unit tests for the default conversion methods are missing; they
will be added in the near future, hopefully)