This is a little subset of the data :
I have :
Id var1 var2
1 POS NA
1 NA NEG
2 NEG NA
2 NA NEG
3 POS NA
3 NA NEG
4 POS POS
5 POS NA
My ideal output
Id var1 var2
1 POS NEG
2 NEG NEG
3 POS NEG
4 POS POS
5 POS NA
I would simply like to delete duplicated Id and have one row per unique id with the good result in var1 and var2. Anyone see the issue? Help would be greatly appreciated. Thank you !
question from:https://stackoverflow.com/questions/65940513/delete-duplicated-rows-in-r-with-conditions-in-other-columns