I have a string s="70 75 none 80" that I would like to convert to an
robjects.FloatVector f, which in R would be f<-(70, 75, NA, 80)
Under py2-2.0, this works for me:
>>> import rpy2.robjects as robjects
>>> readings="70 80 none 90"
>>> f=robjects.FloatVector(readings.split(" "))
>>> print(f)
[1] 70 80 NA 90
Under py2 2.3.0dev, I get the following:
>>> import rpy2.robjects as robjects
>>> readings="70 80 none 90"
>>> f=robjects.FloatVector(readings.split(" "))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/usr/local/lib/python2.7/dist-packages/rpy2/robjects/vectors.py", line
402, in __init__
obj = FloatSexpVector(obj)
ValueError: Error while trying to convert element 2 to a double.
What is the current way to get f<-(70, 75, NA, 80)?
Thank you
Bill
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list