Lattice plot commands comprise the following four parts:
- Graph type: This can be bwplot, xyplot, densityplot, splom, and so on
- Formula: Variables and factor variables separated by |
- Data: A data frame containing values
- Annotations: These include caption, x axis label, and y axis label
In the boxplot, step 2, the ~auto$mpg|cyl.factor formula instructs lattice to make the plot with mpg on the x axis, grouped by factors representing cylinders. Here, we have not specified any variable for the y axis. For boxplots and density plots, we need not specify the y axis. The output for boxplot resembles the following diagram:
In the ...