General aspects
The qplot
(quick plot) function is a basic high-level function of ggplot2
. The general syntax that you should use with this function is the following:
qplot(x, y, data, color, shape, size, facets, geom, stat)
The definitions of the various components of this function are as follows:
x
andy
: These represent the variables to plot (y
is optional, with a default value ofNULL
).data
: This defines the dataset containing the variables.color
,shape
andsize
: These are the aesthetic arguments that can be mapped on additional variables.facets
: This defines the optional faceting of the plot based on one variable contained in the dataset.geom
: This allows you to select the actual visualization of the data, which, basically, will define the plot that will be generated. The possible values arepoint
,line
, andboxplot
, and we will see several different examples in the next pages.stat
: This defines the statistics to be used for the data.
These arguments represent the most important options...