I have a data frame that currently looks like this:
ID Freq A 10 B A G 6 B 11 C 6 C 7 D E
The data frame that I am after is this:
ID Freq A 10 G 6 B 11 C 6 C 7 D E
I am currently trying to write a loop that identifies duplicates in the
ID column and then removes the duplicate row with the blank
Freq value. If there are duplicate
IDs where both have values in
Freq, I don’t want to delete them. Where do I begin with this? Would I use the
duplicated function to identify the duplicates?
EDIT: Edited to add some rows to show that I want to retain a blank Freq value if the ID is not a duplicate.