library(palmerpenguins)
library(tidyverse)Module 1 Lesson 1 Application
The mpg dataset
The relevant variables are:
- displ, a car’s engine size, in litres.
- hwy, a car’s fuel efficiency on the highway, in miles per gallon (mpg).
- class, type of car.
ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, color = class))ggsave(filename = "application1.png")The plot shows a negative relationship between engine size (displ) and fuel efficiency (hwy). In other words, cars with big engines use more fuel.