Module 1 Lesson 1 Application

Author

Jamal Rogers

Published

May 11, 2023

library(palmerpenguins)
library(tidyverse)

The mpg dataset

The relevant variables are:

  1. displ, a car’s engine size, in litres.
  2. hwy, a car’s fuel efficiency on the highway, in miles per gallon (mpg).
  3. 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.