p class="caption">
FIGURE 2.9: Frequency polygons of diamond price by diamond clarity. This visualization indicates there may be significant main effects.
</p>
</div>
<p>Now, to see how <code>price</code> varies with both <code>cut</code> and <code>clarity</code>, we could repeat this same visualization for each level of <code>cut</code>. This is where <strong>ggplot2</strong>’s <code>facet_wrap()</code> comes in handy. Moreover, to facilitate comparisons, we can have <code>geom_freqpoly()</code> display 