I want to replace distinct values in the 'Grade' column with NA if the values in the 'ID' column are duplicates.
This is my data frame currently:
ID Name Grade
1001 Mary 10
1002 John 9
1002 John 10
1003 James 12
And this is what I want the data frame to look like:
ID Name Grade
1001 Mary 10
1002 John NA
1002 John NA
1003 James 12
How would I go about accomplishing this?
Thanks!