Skip to content
xuexue edited this page Feb 13, 2012 · 1 revision

Facetting a plot by a variable produce multiple, smaller charts, one for each value of that variable

The object gg.facet.wrap can be initialized by calling gg.facet.wrap(var) with the appropriate variable, and then bound to a gg.graph object to take effect. It causes the graph to be split into multiple plots in a grid, with wrapping in case there are many values for the variable.

The number of rows and columns can be set using the member functions nrow() and ncol(), respectively.

The object gg.facet.grid can be initialized by calling gg.facet.grid(var1, var2) with the appropriate variable, and then bound to a gg.graph object. It creates a grid of graphs, where the rows depends on var1 and columns on var2

Clone this wiki locally