From 1aeec599b90c0c012126a7aa1938b66093f0cbab Mon Sep 17 00:00:00 2001 From: Nischal Shrestha Date: Sat, 3 Oct 2020 10:38:39 -0400 Subject: [PATCH] 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. --- visualize.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visualize.Rmd b/visualize.Rmd index 216d6dc..1b9e48f 100644 --- a/visualize.Rmd +++ b/visualize.Rmd @@ -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))) ```