From 79981d598f4eedf2f7e068c94f30ec69fe9a2058 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 7 Sep 2022 17:23:18 -0500 Subject: [PATCH] Clarify exercise Fixes #794 --- data-visualize.qmd | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/data-visualize.qmd b/data-visualize.qmd index d8f524b..9574f0b 100644 --- a/data-visualize.qmd +++ b/data-visualize.qmd @@ -724,10 +724,20 @@ ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) + geom_smooth(se = FALSE) ``` -3. What does `show.legend = FALSE` do? - What happens if you remove it?\ +3. Earlier in this chapter we used `show.legend` without explaining it: - Why do you think we used it earlier in the chapter? + ```{r} + #| eval: false + ggplot(data = mpg) + + geom_smooth( + mapping = aes(x = displ, y = hwy, color = drv), + show.legend = FALSE + ) + ``` + + What does `show.legend = FALSE` do here? + What happens if you remove it? + Why do you think we used it earlier? 4. What does the `se` argument to `geom_smooth()` do?