I want to replace the NA value in dfABy from the column A, with the value from the column B, based on the year of column year. For example, my df is:
>dfABy
A B Year
56 75 1921
NA 45 1921
NA 77 1922
67 41 1923
NA 65 1923
The result what I will attend is:
> dfABy
A B Year
56 75 1921
*45* 45 1921
*77* 77 1922
67 41 1923
*65* 65 1923
P.S: with the * the value replacing in column A from column B for every year