I’ve the following dataframe (With many records) and would like to retrieve the entire row for each day with maximum differences.
require(dplyr)
# This gets the maximum value for each date
maxInfo = results %>% group_by(t) %>% summarise(Value = max(differences))
I’m able to get the max value for each day but how to get the entire row?
>Solution :
A possible solution, using slice_max:
library(dplyr)
results %>% group_by(t) %>% slice_max(differences)
