Learning R in Practice

ggplot

Plotting with a grammar.

Simply plot

Advanced plot

plot with multiframe

In ggplot, the frame is named with facet. To control the layout, we could use the following methods:

qplot(x, y, data=data, facets=.~z)
qplot(x, y, data=data, facets=z.~)