The dataset is nycflights13.R. I'm unable to get the required answer:
- ATL 895
- BOS 422
When I run my code I can get the top for ATL but not for BOS, I'm having trouble narrowing down the resulting df to just the two answers.
flights %>%
filter(dest == 'ATL' | dest == 'BOS') %>%
group_by(dest) %>%
select(dest, max_arr_delay = arr_delay) %>%
arrange(desc(arr_delay) %>%
as.data.frame()
I am missing the step that would limit this dataframe. I get both the max answers for ATL and BOS but BOS is buried by the arrange function. How do I limit this so I get both the max values for just ATL and BOS.