Re: [R] Matching and merging two rows with missing values

2007-10-11 Thread Iris Kolder
Thank you for your help this works!! x <-c("AA","AG","GG",NA, NA) y <- c(NA, "AG", "GG", "AA", NA) x[is.na(x)] <- y[is.na(x)] Hello, I have two rows which are almost identical but miss different values at different locations. I would like to merge these two rows so that the missing values

Re: [R] Matching and merging two rows with missing values

2007-10-11 Thread Dimitris Rizopoulos
"Iris Kolder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 11, 2007 3:32 PM Subject: [R] Matching and merging two rows with missing values > Hello, > > > > I have two rows which are almost identical but miss different values > at > di

[R] Matching and merging two rows with missing values

2007-10-11 Thread Iris Kolder
Hello, I have two rows which are almost identical but miss different values at different locations. I would like to merge these two rows so that the missing values are replaced by the element in the same column on the other row making one row. If both rows contain a NA, NA remains in the outpu