library(dplyr)
# Longest departure delays
nycflights %>%
select(flight, origin, dest, dep_delay, arr_delay) %>%
arrange(desc(dep_delay))
# Longest arrival delays
nycflights %>%
select(flight, origin, dest, dep_delay, arr_delay) %>%
arrange(desc(arr_delay))
Run the code above in your browser using DataLab