Question: In this question, we will use flights dataset from nycflights 1 3 package. Using flight dataset, ( 6 0 points ) a ) write a

In this question, we will use flights dataset from nycflights13 package. Using flight
dataset, (60 points)
a) write a script to find all flights that Had a departure delay of 12 or more hours and arrival
delay of 18 or more hours. (10 points)
b) write a script to find all Summer flights with Departure in July, August, or September
that are operated by JetBlue Airways ("B6") that flew from JFK and arrived at MIA or
BQN (10 points)
c) write a script, using select() function, to select subset of data that include all columns but
the following: distance, hour, minute, time_hour (10 points)
d) write a script, using mutate() function, to add a new column representing flight operation
costs. In here, the cost of operation for each flight is considered as the sum of air-time
cost ($5 per hour of air time) and fly distance cost ($3 per mile traveled)(10 points)
e) write a script that calculates the correlation between every numerical column in flights
dataset. (20 points)
Hint: you need to
i) remove all non-numerical columns from the dataset using select() function,
ii) you need to remove all missing values (NA) from your dataset. This can be achieved
by either removing all columns from remaining set that contains missing values (NA),
or removing all rows from dataset that contains missing values (NA)
iii) use cor() function with the trimmed dataset to calculate all pairwise correlations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!