This lab is a bit different from the others. We’ll be working through the exercises together as a class, but be sure to record them in your lab report like normal. You can find these exercises in the slides, which are posted here. The On Your Own component will be as usual, on your own (or in pairs). To be sure you have all the necessary packages loaded, be sure to add the following chunk at the top of your lab report.

knitr::opts_chunk$set(message = FALSE, warning = FALSE)
library(dplyr)
library(ggplot2)
library(oilabs)
library(pnwflights14)

On your own

For the following questions, it may be helpful to sketch out what you want the final data set to look like (what are the rows? what are the columns?), then work backwards to figure out how to create that dataset from the original data.

ggplot(delay, aes(dist, delay)) +
 geom_point(aes(size = count), alpha = 1/2) +
 geom_smooth() +
 scale_size_area()

Challenge: Remake two plots that show up in the slides - the points plot of average delays by carrier and the bar chart of total count of flights by carrier out of PDX - but display the carriers in descending order.