Show frequencies along with barplot in ggplot2

Posted by aL3xa on Stack Overflow See other posts from Stack Overflow or by aL3xa
Published on 2010-03-31T10:00:59Z Indexed on 2010/03/31 10:03 UTC
Read the original article Hit count: 628

Filed under:
|
|

I'm trying to display frequencies within barplot ... well, I want them somewhere in the graph: under the bars, within bars, above bars or in the legend area. And I recall (I may be wrong) that it can be done in ggplot2. This is probably an easy one... at least it seems easy. Here's the code:

p <- ggplot(mtcars)
p + aes(factor(cyl)) + geom_bar()

Is there any chance that I can get frequencies embedded in the graph?

© Stack Overflow or respective owner

Related posts about r

    Related posts about ggplot2