[R] replacement

John Kane jrkrideau at yahoo.ca
Fri Oct 19 15:56:18 CEST 2007


mydata[is.na(mydata)]  <-  NaN

should work

--- Samor Gandhi <samorgandhi at yahoo.com> wrote:

> Hi, Is it possible to do the following 
>  
> > mydata
>    y    x
> 1  0.3  1
> 2  0.8  NA
> 3  NA   0
> 4  0.2  1
>  
> I would like to solve 
>  
>  mydata <- replace(mydata, NA, NaN)
>  
> Thanks!



More information about the R-help mailing list