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 output.

 

               1     2     3     4     5

Row1  AA AG GG NA NA

Row2  NA AG GG AA NA

 

The output i want is one row

 

            1     2     3     4     5

Row AA AG GG AA NA

 

I tried to use the functions match,grep, and gsub but I can't seem to make
it work I would appreciate any suggestions!

 

Best regards,

 

Iris Kolder


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to