It looks like you want to do the following. With your data in a csv call bar.csv
having this format:
Dept Mean Median Trimmed_Mean
Lobby 0.008 0.0018 0.0058
R & D 6.25 3.2 4.78
ROE 19.08 16.66 16.276
You can use library(ggplot2)
both the library(reshape)
commands given here.
dat.m<-read.csv("bar.csv")
dat.m<-melt(dat.m,id.vars="Dept")
ggplot(dat.m, aes(x = Dept, y = value,fill=variable)) + geom_bar(stat='identity')+
facet_wrap(~ Dept, ncol = 3,scales="free_y")
ggplot(dat.m, aes(x = Dept, y = value,fill=variable)) + geom_bar(stat='identity')
To display the graphs below:
zhaoy, () - . , library(ggplot2)
boxplot, ( spray
ggplot2):
library(ggplot2)
p<-qplot(spray,count,data=InsectSprays,geom='boxplot')
p<-p+stat_summary(fun.y=mean,shape=1,col='red',geom='point')
print(p)
boxplot
, , :
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
means <- tapply(InsectSprays$count,InsectSprays$spray,mean)
points(means,col="red",pch=18)