use `stat()` instead of `..` in "3.7 Statistical transformations" (#751)

https://r4ds.had.co.nz/data-visualisation.html#statistical-transformations
This commit is contained in:
Zhuoer Dong 2020-01-16 02:40:37 +08:00 committed by Hadley Wickham
parent 6eb53ea069
commit e25d3ac51b
1 changed files with 1 additions and 1 deletions

View File

@ -522,7 +522,7 @@ This works because every geom has a default stat; and every stat has a default g
```{r}
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut, y = ..prop.., group = 1))
geom_bar(mapping = aes(x = cut, y = stat(prop), group = 1))
```
To find the variables computed by the stat, look for the help section