In: Statistics and Probability
Load the package nycflights13 with library(nycflights13). If you are on running R Studio locally, you must install this package before you can use it!
# install.packages("nycflights13")
library(nycflights13)
library(ggplot2)
library(dplyr)
data(flights)
data(airports)
data(airlines)
Question 2
The dataset `airlines` contains the full name of the carrier (examine it!). Join the dataset with the flights dataset so all of the information in `flights` is retained. Using the merged dataset, which carrier (`name`) has the longest average departure delay? Which has the shortest?
install.packages("nycflights13")
library(nycflights13)
library(ggplot2)
library(dplyr)
data(flights)
data(airports)
data(airlines)
flights = merge(flights,airlines,by= "carrier", all.x=TRUE)
flights[which.max(flights$dep_delay),]
flights[which.min(flights$dep_delay),]
longest is for
Hawaiian Airlines Inc.
shorted is for
JetBlue Airways