1 Matching Annotations
- Nov 2020
-
jrnold.github.io jrnold.github.io
-
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())
-