[R] replacement

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Oct 19 14:32:56 CEST 2007


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

Uwe Ligges


Samor Gandhi 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!
>  __________________________________________________
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list