[R] replacing NA's with various numbers

Nigel.Walker at studentmail.newcastle.edu.au Nigel.Walker at studentmail.newcastle.edu.au
Sat Oct 6 04:27:45 CEST 2007


Hi 
I have two vectors in the same style as
x<-c(NA,NA,1,3,4,NA,1)
y<-c(0,0,NA,NA,NA,0,NA)

that is when x[ i ] = NA,  y[ i ]=numeric. I wish to replace the NA's in x by the corresponding y value. Any help would be much appreciated.
Nigel



More information about the R-help mailing list