I have a column in my df such as the EVENTDATE above which contains dates repeated and I want keep them as they are but create a new column as ADMISSION and only keep one of the value from EVENTDATE in it as shown above. How can I achieve this using R?
structure(list(ID = c(1, 1, 1, 2, 2), EVENTDATE = structure(c(18294,
18294, 18294, 18322, 18322), class = "Date"), ADMISSION = structure(c(18294,
NA, NA, 18322, NA), class = "Date")), row.names = c(NA, 5L), class = "data.frame")