1 Matching Annotations
  1. Nov 2020
    1. I think this alternative answers Exercise 5.7.8 with fewer lines of code. Note though that the answers don't coincide, i.e., I don't havet any tailnum with zero flights before the first 1-hour delay:

      flights %>%
        filter(!is.na(arr_delay)) %>%
        arrange(tailnum, arr_delay) %>%
        group_by(tailnum) %>%
        filter(cumall(arr_delay < 60)) %>%  ## all until this 
        condition is false
        summarise(n = n())