# Use this R-Chunk to import all your datasets!
library(nycflights13)

Introduction

You just started your internship at a big firm in New York, and your manager gave you an extensive file of flights that departed JFK, LGA, or EWR in 2013. From this data (nycflights13::flights), which you can obtain in R (install.packages(“nycflights13”); library(nycflights13)), your manager wants you to answer the following questions:

1. For each origin airport (JFK, EWR, LGA), which airline has the lowest 75th percentile of delay time for flights scheduled to leave earlier than noon?


2. Which origin airport is best to minimize my chances of a late arrival when I am using Delta Airlines?


If I were flying Delta and wanted to minimize my risk of having a delayed arrival, I would choose to fly into JFK. JFK has the smallest percentage of delayed arrivals with Delta. While they only have around 10% fewer delays than EWR and around 5% fewer than LGA, that is still an advantage to consider. The chart makes it clear that there is an obvious difference when flying Delta into JFK.

3. Which destination airport is the worst (you decide on the metric for worst) for arrival delays?



The “Chance of Delayed Arrival” chart here shows that EWR has the highest percentage of delayed arrivals. In the second chart, “Average Delay Time by Airport”, we also see that EWR also has the worst average arrival delay time. The metric for having the worst arrival delays in these charts is percentage of arrivals being late and the average amount of time the arrival is delayed. Although EWR ranks as the worst for both of these metrics, JFK and LGA don’t fall very far behind.