January 2019
Beginner to intermediate
352 pages
9h 8m
English
This appendix provides an alternative solution to the problem of visualizing data. There are many reasons why ggplot2 can be seen as a superior method of visualizing data, not least of which is the sophisticated application of the “grammar of graphics” philosophy. That’s not to say that what you’re about to see is useless, but as you learn more about ggplot2, you’ll have fewer and fewer reasons to ever use these functions.
The simplest way to generate a base plot is to call plot() with vectors of x and y data, as in figure C.1:
plot(x = mtcars$disp, y = mtcars$mpg)
You’ll notice a few major differences in how this is written and what is produced. First, since you’re passing vectors (not bare names of columns), ...