I have table 1 below:
| A | B | C |
|---|---|---|
| 1 | M | 12 |
| 2 | F | 13 |
| 3 | F | NA |
| 5 | M | 17 |
| 6 | F | NA |
| 7 | M | NA |
And table2:
| A | B | C |
|---|---|---|
| 3 | F | 11 |
| 6 | F | 19 |
| 7 | M | 15 |
I would like to replace the NA value in column C from table 1 with the value in column C from table 2 based on column A and column B in both tables 1 and 2.
How to write code in R?