From R for Data Science
Exercises 10.3.1
10.3.1 Exercises
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_smooth(aes(color = drv), show.legend = FALSE)
It removes the legend. I think it was used earlier to conserve space for the chart
It sets the confidence interval around smooth, and is TRUE by default
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 3) +
geom_smooth()
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 3) +
geom_smooth(aes(group = drv))
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 3, aes(color=drv)) +
geom_smooth(aes(group = drv, color = drv))
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 3, aes(color=drv)) +
geom_smooth()
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 3, aes(color=drv)) +
geom_smooth(aes(linetype = drv))
ggplot(mpg, aes(x = displ, y= hwy)) +
geom_point(size = 7, color="white") +
geom_point(size = 3, aes(color=drv))