I have two dataframes:
df1
Col1 Col2 Col3 Col4
1 0 3 5
NA 1 NA 0
2 3 NA 5
df2
Col1 Col2 Col3 Col4
7 0 5 7
0 8 0 0
9 9 6 2
How do I replace df2
with NA
's by same position of df1
?
I want my final df3 to look like this:
Col1 Col2 Col3 Col4
7 0 5 7
NA 8 NA 0
9 9 NA 2