[R] Replace NaN with zero

Alexandre Swarowsky aleswar at yahoo.com.br
Tue Nov 25 17:40:22 CET 2008


what about ?sub and ?ifelse

Spilak,Jacqueline [Edm] wrote: 
> I need help with replacing NaN with zero (the value '0') in my dataset.
> The reason is that I can't get it to graph because of the NaN in the
> dataset.  I have tried: 
> data[is.nan(data)] <- 0
> that others have suggested in the help archives but this does nothing so
> I am not sure what I am doing wrong.
> Thanks in advance for your help. 
> 	[[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.



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com



More information about the R-help mailing list