Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions