Re: [R] NA problem when use paste function

2008-04-17 Thread Lu, Jiang
Thank you very much, Dr. Ripley. The solution "ifelse()" you provided is exactly what I want. I am so happy this morning for that I recieved your email. Yesterday night I was trying to write a loop to substitute NA. But now I learn that "ifelse()" does a much more efficient work. Really appreciate

Re: [R] NA problem when use paste function

2008-04-16 Thread Prof Brian Ripley
On Wed, 16 Apr 2008, Lu, Jiang wrote: > Dear R helpers, > > I was doing a genetic project with two datasets X and Y. There are > some IDs in both data sets, and others in either data set. I used > "merge(x,y,by="ID",all=TRUE)". The data set Y contains a variable (a > genotype) which is also in dat

[R] NA problem when use paste function

2008-04-16 Thread Lu, Jiang
Dear R helpers, I was doing a genetic project with two datasets X and Y. There are some IDs in both data sets, and others in either data set. I used "merge(x,y,by="ID",all=TRUE)". The data set Y contains a variable (a genotype) which is also in data X. When I merge X with Y, these two variables we