I run the code below and it worked perfectly until I changed from 'filter(x, is.na(dep_time))' to 'filter(x, !is.na(dep_time))'. I lost all my observations in environment. However, when cleaned the environment and run 'filter(x, !is.na(dep_time))', it worked again.
It might be because in the first filter fl = fl %>% filter(is.na(dep_time)), you go from 336,776 x 19 to 8,255 x 19 (only where dep_time is NA).
Then when you change it to fl = fl %>% filter(!is.na(dep_time)), you are using the already filtered fl, so going from 8,255 x 19 to 0 x 19 as there are no rows of dep_time that have values left. They have already been filtered out the first time.