r4ds-exercise-solutions icon indicating copy to clipboard operation
r4ds-exercise-solutions copied to clipboard

Exercise 3.2.5 requires a minor change to be correct

Open mubangansofu opened this issue 3 years ago • 1 comments

Based on the Exercise question, the ordinate should be class, hence our code should swap the positions of x and y. One can write

mpg %>% ggplot()+ geom_point(aes(drv,class))

or

ggplot(mpg, aes(x = drv, y = class)) + geom_point()

mubangansofu avatar Apr 10 '21 13:04 mubangansofu

@mubangansofu Thank you so much for pointing this out. :) Initially, I got confused since in exercise 3.2.5 it says "[..] class vs drv [...]". Thus, the variable "drv" should be plotted on the horizontal bar and the variable "class" on the vertical bar.

11learner avatar Aug 21 '21 15:08 11learner