[Rpy] Converting non-numbers to NA in robjects.FloatVector?

2011-10-04 Thread William T. Martin
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

[Rpy] Converting non-numbers to NA in robjects.FloatVector?

2011-10-04 Thread William T. Martin
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)

Re: [Rpy] Converting non-numbers to NA in robjects.FloatVector?

2011-10-04 Thread Laurent Gautier
On 2011-10-05 02:48, William T. Martin wrote: > 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=