I am using the library(nycflights13) and I use the following command to group_by month and day, select the top 3 rows within each group and then sort in descending order wit
You need to add .by_group=T to arrange within groups.
.by_group=T
flights %>% group_by(month, day) %>% top_n(3, dep_delay) %>% arrange(dep_delay, .by_group = TRUE)