Set up
We have already loaded the R packages you need for this tutorial. Once you start working in RStudio, you will run code like the code shown below to load the R packages you need.
Please enable JavaScript to experience the dynamic code cell content on this page.
Exercises
All exercises are from R for Data Science 2nd Edition .
In a single pipeline for each condition, find all flights that meet the condition:
Had an arrival delay of two or more hours
Flew to Houston (IAH or HOU)
Departed in summer (July, August, and September)
Arrived more than two hours late but didn’t leave late
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
How do delays vary over the course of the day? Illustrate your answer with a plot.
Please enable JavaScript to experience the dynamic code cell content on this page.
Suppose we have the following tiny data frame:
Please enable JavaScript to experience the dynamic code cell content on this page.
For each of the following, what you think the output will look like? Check if you were correct by running the chunk.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Open code chunk
Here is a code chunk in case you wish to play around with some code
Please enable JavaScript to experience the dynamic code cell content on this page.