Use after_stat instead of the old dotted syntax. (#851)

The `..` syntax in 3.7 Exercises to refer to computed variable `prop` should be updated to use the best practice of `after_stat` instead. Reduces confusion and more aligns with the documentation.
This commit is contained in:
Nischal Shrestha 2020-10-03 10:38:39 -04:00 committed by GitHub
parent 0d08b14b2f
commit 1aeec599b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -565,9 +565,9 @@ ggplot2 provides over 20 stats for you to use. Each stat is a function, so you c
```{r, eval = FALSE}
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut, y = ..prop..))
geom_bar(mapping = aes(x = cut, y = after_stat(prop)))
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut, fill = color, y = ..prop..))
geom_bar(mapping = aes(x = cut, fill = color, y = after_stat(prop)))
```