This chapter provides a step-by-step introduction to creating graphs using qplot
(a graphics tool within the ggplot2
package), and gives examples of functioning qplot
code that can be adapted for many applications. The topics covered in this chapter are as follows:
ggplot2
package in order to use qplot
qplot
graphics techniques and syntaxIt is not possible to give a complete account of qplot
in this book. However, by the end of this chapter, you should be able to use qplot
to create a wide range of graphs for research and analysis.
The qplot
(quick plot) system is a subset of the ggplot2
(grammar of graphics) package, which you can use to create nice graphs easily. To use qplot
, first install ggplot2
. On the R command line, enter the following command:
install.packages("ggplot2")
Then load ggplot2
using this command:
library(ggplot2)