I have a list of samples and a second list of the same samples, plus their values. In the second one, some rows are missing; thus, I want to compare the two tables to find which one is missing and fill it with NA. Each sample is in triplicates. The tables look like the following ones:
Table A Table B
------------------------ ----------------------------------
Name treat. n Name treat. n Value
AA H 1 AA H 1 x1
AA H 1 AA H 1 x2
AA H 1 AA H 1 x3
BB C 2 BB C 2 y1
BB C 2 BB C 2 y2
BB C 2 CC H 3 z1
CC H 3
CC H 3
CC H 3
What I would like to have is something like this. Can you help me to write the code? Thank you very much for your help.
Name treat. n Value
----------------------------------
AA H 1 x1
AA H 1 x2
AA H 1 x3
BB C 2 y1
BB C 2 y2
BB C 2 NA
CC H 3 z1
CC H 3 NA
CC H 3 NA