r4ds-exercise-solutions
r4ds-exercise-solutions copied to clipboard
Wrong axis order in Exercise 3.2.5
Exercise 3.2.5 on page https://jrnold.github.io/r4ds-exercise-solutions/data-visualisation.html asks
What happens if you make a scatter plot of class vs drv? Why is the plot not useful?
The proposed solution you give to make the plot is:
ggplot(mpg, aes(x = class, y = drv)) +
geom_point()
But the correct solution is to plot the axis as "y-axis variable vs. x-axis variable." so it should be:
ggplot(mpg, aes(x = drv, y = class)) +
geom_point()