This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Combining tests using boolean operators | |
# All flights that departed before 5am or arrived after 10pm | |
filter(hflights, DepTime < 500 | ArrTime > 2200 ) | |
# All flights that departed late but arrived ahead of schedule | |
filter(hflights, DepDelay > 0 & ArrDelay < 0) | |
# All cancelled weekend flights | |
filter(hflights, DayOfWeek %in% c(6,7) & Cancelled == 1) | |
# All flights that were cancelled after being delayed | |
filter(hflights, Cancelled == 1, DepDelay > 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment