Get min and max values with group_by in dplyr

library(dplyr) df %>% group_by(group_variable) %>% filter(value == max(value))

df %>% group_by(group_variable) %>% filter(value == max(value))

via stackoverflow