Want to remove duplicated rows unless NA value exists in columns
问题 I have a data table with 4 columns: ID, Name, Rate1, Rate2. I want to remove duplicates where ID, Rate1, and Rate 2 are the same, but if they are both NA, I would like to keep both rows. Basically, I want to conditionally remove duplicates, but only if the conditions != NA. For example, I would like this: ID Name Rate1 Rate2 1 Xyz 1 2 1 Abc 1 2 2 Def NA NA 2 Lmn NA NA 3 Hij 3 5 3 Qrs 3 7 to become this: ID Name Rate1 Rate2 1 Xyz 1 2 2 Def NA NA 2 Lmn NA NA 3 Hij 3 5 3 Qrs 3 7 Thanks in