From my dataframe, I would need to remove the non useful information labelled as "Not done" and keep the interesting one "Neg" available from one the duplicated ID. Sorry not easy to explain. So, my dataframe below :
df <- data.frame(ID = c("A1", "A1", "A1", "A2", "A2","A2", "A3","A3", "A3"),
Variable1 = c("Neg", "Not Done","Not Done", "Not Done", "Neg", "Not Done", "Not Done", "Not Done", "Not Done"),
Variable2 = c("Not Done", "Neg", "Not Done", "Neg", "Not Done", "Not Done", "Not Done", "Not Done", "Not Done"),
Variable3 = c("Not Done","Not Done","Neg","Not Done","Not Done","Neg","Not Done","Not Done","Not Done"))
An example of the expected output :
df_A <- data.frame(ID = c("A1", "A2", "A3"),
Variable1 = c("Neg", "Neg", "Not Done"),
Variable2 = c("Neg", "Neg", "Not Done"),
Variable3 = c("Neg","Neg","Not Done"))
As you can see, A3, all the values are "Not Done" and so need to keep it once.