Are cars with bigger engines less fuel efficient ?
</div>
`ggplot2` is a system for declaratively creating graphics, based on [The Grammar of Graphics](https://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448/ref=as_li_ss_tl). You provide the data, tell `ggplot2` how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.
`ggplot2` is a system for declaratively creating graphics, based on [The Grammar of Graphics](https://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448/ref=as_li_ss_tl). You provide the data, tell `ggplot2` how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.
```
```
...
@@ -214,9 +230,13 @@ ggplot(data = <DATA>) +
...
@@ -214,9 +230,13 @@ ggplot(data = <DATA>) +
- you begin a plot with the function `ggplot()`
- you begin a plot with the function `ggplot()`
- you complete your graph by adding one or more layers
- you complete your graph by adding one or more layers
- `geom_point()` adds a layer with a scatterplot
- `geom_point()` adds a layer with a scatterplot
- each geom function in `ggplot2` takes a `mapping` argument
- each **geom **function in `ggplot2` takes a `mapping` argument
- the `mapping` argument is always paired with `aes()`
- the `mapping` argument is always paired with `aes()`
<div class="pencadre">
What happend when you use only the command `ggplot(data = mpg)` ?
</div>
<div class="pencadre">
<div class="pencadre">
Make a scatterplot of `hwy` ( fuel efficiency ) vs. `cyl` ( number of cylinders ).
Make a scatterplot of `hwy` ( fuel efficiency ) vs. `cyl` ( number of cylinders ).
...
@@ -226,7 +246,7 @@ Make a scatterplot of `hwy` ( fuel efficiency ) vs. `cyl` ( number of cylinders
...
@@ -226,7 +246,7 @@ Make a scatterplot of `hwy` ( fuel efficiency ) vs. `cyl` ( number of cylinders