--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Hi Brandon-There are several ways to look at this. Most plainly, I want the abscissa and ordinates of the plotted histograms... each one of them. They could be in individual vectors or in a data frame, i dont really care. The later would be more "slick", but is not necessary.I could use table() or hist() but then I have to do all the clumsy subsetting. Why I'm approaching this through ggplot2 is because it clearly makes the histogram calculations over the facet group; a single command is both subsetting and generating the histograms. The syntax for achieving what i want is really easy, a one liner. Doing it manually via other methods seems to take way too much work.I'm sure there are certainly multiple ways to achieve this, I'm not tied to ggplot but if i could learn to get the coordinates I desire, that could be useful. I examined the m object and didnt discover what I was looking for.James
without warranty to work in future:
m <- ggplot(movies, aes(x=rating)) + geom_histogram(binwidth = 0.5)
ob <- m + facet_wrap(~ mpaa)
dp <- ggplot_build(ob)$data
dp[[1]][,]
--
Kohske Takahashi <takahash...@gmail.com>
Research Center for Advanced Science and Technology,
The University of Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html
It's not hard to compute the essence of a histogram yourself:
movies$rating_bin <- round_any(movies$rating_bin, 0.5)
count(movies, c("rating_bin", "mpaa")
But for more detail it really depends on what you want to do with the results.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/