I have a dataframe containing many duplicate names, below is a reproducible example.
I am trying to clean the dataset by removing rows that have duplicate names AND lowest information.
I have added a column where I calculate % of NA of cells in each row, in my example I have called it %_Scoring.
Among the duplicate name rows I want to keep the row that have the lowest %_Scoring (% of NA)
N:B If %_Scoring is equal, it does not matter, one of the two rows should still be removed.
data_people <- "https://raw.githubusercontent.com/max9nc9/Temp/main/data_people.csv"
data_people <- read.csv(data_people, sep = ",")
In the above data example, I would only keep 2 rows:
- First row is Margarita Pan
- Second row is John Doe where %_Scoring = 0.56