服务热线
178 0020 3020
datar41<-read.csv("C:/Documents and Settings/Administrator/桌面/s/r/第四次作业/R.4-1.csv",header=T)
library(ggplot2)
datar41 = datar41[order(datar41$值,decreasing=TRUE),]
mylabel=as.vector(datar41$"代码")
mylabel=paste(mylabel,"",round(datar41$值/sum(datar41$值)*100,2),"%)",sep="")
ggplot(datar41,aes(x="",y=值,fill=代码))+geom_bar(stat="identity",width =2)+coord_polar(theta= "y",direction=-1)+labs(x="city",y="value",title="R2-30")+theme(axis.ticks = element_blank())+theme(legend.title=element_blank(),legend.position = "top")+scale_fill_discrete(breaks=datar41$代码,labels=mylabel)+theme(axis.text.x =element_blank())
install.packages(lattice)
library(lattice)
ggplot(data=singer,aes(y=height,x=voice.part,fill=voice.part))+geom_boxplot()+theme(legend.title=element_blank(),legend.position = "top")+labs(title="R2-30")
附件