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
"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
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
3 matches
Mail list logo