This dataset contains a subset of the fuel economy data that the EPA makes available on http://fueleconomy.gov . It contains only models which had a new release every year between 1999 and 2008.
...
...
@@ -196,19 +197,19 @@ View(mpg)
\
### Updated version of the data
<!-- ### Updated version of the data -->
`mpg` is loaded with tidyverse, we want to be able to read our own data from
<!-- `mpg` is loaded with tidyverse, we want to be able to read our own data from -->
`ggplot2` will automatically assign a unique level of the aesthetic (here a unique color) to each unique value of the variable, a process known as scaling. `ggplot2` will also add a legend that explains which levels correspond to which values.
geom_point(mapping = aes(x = displ, y = hwy, color = class))
```
### Aesthetic mappings : `color`
`ggplot2` will automatically assign a unique level of the aesthetic (here a unique color) to each unique value of the variable, a process known as scaling. `ggplot2` will also add a legend that explains which levels correspond to which values.