I want to identify duplicates in the
IDcolumn but only whenWave==2(in the below example only'C'is duplicated in wave 2).I then want to select the latest duplicate based on
Dateand delete it from the dataframedf.
How do I do the above?
structure(list(ID = c("E", "G", "C", "B", "D", "E", "A", "D",
"F", "F", "C", "A", "B", "C", "A"), Wave = c(2L, 1L, 1L, 2L,
2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 1L), Date = c("25/02/2020",
"18/02/2020", "14/02/2020", "21/02/2020", "24/02/2020", "16/02/2020",
"12/02/2020", "15/02/2020", "17/02/2020", "26/02/2020", "22/02/2020",
"20/02/2020", "13/02/2020", "23/02/2020", "11/02/2020")), class = "data.frame", row.names = c(NA,
-15L))