Starting from:

$34.99

CSCI297B Exercise 6-dplyr library and pipes Solution

For this project, use the dplyr library and pipes.
1. Since sharing projects does not work on our server, you do not have to put this exerciseinto a project. Submit just the R markdown file.
2. Open a new R markdown file in the project called exercise06.Rmd
3. Load the nycflights13 dataset
4. In a single pipeline, find all flights that meet all of the following conditions:
• Had an arrival delay of two or more hours
• Flew to Houston (IAH or HOU)
• Were operated by United, American, or Delta
• Arrived more than two hours late, but didn’t leave late
• Were delayed by at least an hour, but made up over 30 minutes in flight
5. Sort flights to find the flights with longest departure delays. Find the flights that leftearliest in the morning.
6. Sort flights to find the fastest flights. (Hint: Try including a math calculation insideof your function.)
8. Which flights traveled the farthest distance? Which traveled the least distance?
9. Does it matter what order you used filter() and arrange() if you’re using both?Why/why not? Think about the results and how much work the functions would have to do.
1

More products