I have a datafarme:
ID Type Direction
1 A Rigth
1 B Rigth
2 AC Left
2 BC Right
3 C Right
1 A NA
1 B NA
2 AC NA
2 BC NA
3 C NA
1 A NA
1 B NA
2 AC NA
2 BC NA
3 C NA
I want to fill those NA in column Direction accordingly to ID and Type of row (cases with not empty column Direction). So desired result must look like this:
ID Type Direction
1 A Rigth
1 B Rigth
2 AC Left
2 BC Right
3 C Right
1 A Rigth
1 B Rigth
2 AC Left
2 BC Right
3 C Right
1 A Rigth
1 B Rigth
2 AC Left
2 BC Right
3 C Right
How could i do this?