Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5 - Exercise 5.2.1 Question 4 (Trick Question/ Possible Mistake) #585

Open
EnzoNMigliano opened this issue Sep 13, 2020 · 0 comments

Comments

@EnzoNMigliano
Copy link

Hello jrnold, I hope you are well!

In the question 4: "Departed in summer (July, August, and September)"

The solution might be a bit trick... The go to solution is:

filter(flights, month %in% c(7,8,9))

However, it does not consider the fact that a flight might had been schedule for September 30th at 23h59 (military time) and had a delay of 1 or more minutes. Therefore, making the flight departure on October...

A possible way of solving the problem is:

filter(flights, month >= 7, month <= 9, (flight$sched_dep_time + flight$dep_delay) <= 2359)

I am not sure if this is even a real issue (neither if my code really solves the problem Lol), but I wanted to share it anyways. Thank you jrnold and team for providing such amazing info to the community!

Best regards,

EnzoNMigliano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant