服务热线
178 0020 3020
library(ggplot2)
a<-read.csv('e:/R学习小组/4/R4-1.csv')
attach(a)
ap<-值/sum(值)*100;ap
b=as.vector(代码);b
c=paste(b,'(',round(ap,1),'%)')
ggplot(a,aes(x='',y=值,fill=代码))+geom_bar(stat='identity',width=1,position='fill')+coord_polar(theta='y')+labs(x='value',y='city',title='R2-24')+theme(legend.title=element_blank(),legend.position='top',axis.ticks=element_blank())+scale_fill_discrete(labels=c)
library(lattice)
singer
ggplot(singer,aes(x=voice.part,y=height,fill=voice.part))+geom_boxplot()+theme(legend.position='top',legend.title=element_blank())+labs(title="R2-24")
附件