I have this data
data;code
18/02/2020;C106
05/04/2018;C107
11/09/2016;C107
16/02/2019;C109
11/03/2020;C110
04/03/2020;C114
18/02/2020;C114
06/02/2020;C121
I would like to select the most recent date for each code, like this:
data;code
18/02/2020;C106
05/04/2018;C107
16/02/2019;C109
11/03/2020;C110
04/03/2020;C114
06/02/2020;C121
I tried:
tapply(data$data, data$code, max)
But I received this:
Error in Summary.factor(7L, na.rm = FALSE) :
‘max’ not meaningful for factors