I've got the following code which is close to what I want but not quite:
p = ggplot(mtcars, aes_string(x="gear", fill="cyl"))
p = p + geom_histogram() + facet_grid(cyl~.)
p
That plots a bunch of facets showing the histogram/density relative to the whole population in each facet grid but I'd actually like each facet grid's histogram to be the density relative to that group. How can I do this?