#use this code cell
Homework 1: Data Wrangling
Description and Purpose: In this homework assignment, you’ll work with data sets from the {nycflights13}
package. These data sets contain information about flights departing airports in the vicinity of New York City during 2013. The goal is to get practice with wrangling data to answer questions of interest.
Your Tasks
- Install and load the
{nycflights13}
package.
- The package you’ve loaded contains five datasets:
airlines
,airports
,flights
,planes
, andweather
. Use the basic exploratory functions you’ve learned about to explore theairlines
,airports
, andflights
datasets. In particular, you should answer the following for each dataset:
- How many variables are contained in each data set?
- How many observations are contained in each data set?
- What does each observation represent?
#use this code cell
- Compute the average departure delay
dep_delay
for flights out of NYC airports in 2013. Hint: missing (NA
) values are contagious.
#Use this code cell
- Compute the average departure delay
dep_delay
for each individual airport in NYC in 2013. Note: It would be nice to have the names of the airports rather than the FAA airport code.
#Use this code cell
- How many flights out of NYC airports arrived more than an hour late to their destination?
#Use this code cell
- How many flights out of NYC airports arrived more than an hour late to their destination but did not depart late?
#Use this code cell
- Compute the number of flights out of NYC airports arriving more than an hour late to their destination but not departing late, for each airline. Print out the name of the origin airport (not FAA code), airline name (not carrier code), and the counts ordered by the count in descending order.
#Use this code cell
- Use the columns in the
flights
data frame to mutate a new variable calledspeed
(in miles per hour). Use your new variable to find the fastest flight in 2013.
#Use this code cell
- When you are done, knit your notebook to an HTML file and submit both your HTML output and QMD file to BrightSpace using the Homework 1 submission folder.