Re: [R] bar chart with means - using ggplot

2009-09-11 Thread Dianne Cook
I would recommend not representing means by bars at all. Bars are for counts, stacking from zero. Means are point estimates. ggplot has a lot of routines for displaying means with errors bars: geom_linerange, geom_pointrange. To hone your ggplot skills I recommend looking into these geoms.

Re: [R] bar chart with means - using ggplot

2009-09-11 Thread Felipe Carrillo
Like this? # example using qplot library(ggplot2) meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut)) qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50")) dev.new() # create a new graph to compare wi