服务热线
178 0020 3020
> library(ggplot2)
> data1<-read.csv("D:\\learningr\\R4-1-1.csv",head=T)
> data1<-data1[order(data1$value,decreasing = TRUE),]
> myLabel=as.vector(data1$city)
> myLabel=paste(myLabel,"(",round(data1$value/sum(data1$value)*100,2),"%)",sep="")
>ggplot(data1,aes(x="",y=value,fill=city))+geom_bar(stat="identity",width=1)+coord_polar(theta="y")+labs(x="value",y="city",title="R2-40")+theme(legend.position = 'top',legend.title =element_blank(),axis.ticks=element_blank())+scale_fill_discrete(breaks=data1$city,labels=myLabel)
> library(ggplot2)
> library(lattice)
>ggplot(singer,aes(x=voice.part,y=height,fill=voice.part))+geom_boxplot()+theme(legend.position ='top',legend.title = element_blank())+labs(title="R2-40")
附件