I have a dataframe:
df <- data.frame(Xdate = c("21-jul-2020", "29-jul-2020", "20-jul-2020", "13-may-2020" ),
names = c("peter", "lisa","peter", "lisa"),
score = c(1,3,5,7))
What is the most elegant way of getting the latest score out:
df_result <- data.frame(names = c("peter", "lisa"),
score = c(1, 3))
The latest score for peter is 1 and were achieved the 21-jul-2020 and the latest score by lisa is 3 and is achieved the 29-jul-2020.