服务热线
178 0020 3020
任务一
mydata<-read.csv(file="F:\\R学习作业\\20171128\\R.4-1.csv")
library(ggplot2)
mydata<-data.frame(city=c("A","B","C","D","E"),value=c("20","18","16","14","12"))
ggplot(mydata,aes(x="",y=value,fill=city))+
geom_bar(stat="identity",width=1)+
coord_polar(theta="y")+
labs(x="city",y="value")+
ggtitle("R2-17")+
theme(legend.title=element_blank(),legend.position="top")+
theme(axis.ticks=element_blank())
任务二
data(singer,package="lattice")
library(ggplot2)
ggplot(singer,aes(x=voice.part,y=height,fill=voice.part))+
geom_boxplot()+
theme(legend.title=element_blank(),legend.position="top")+
ggtitle("R2-17")
附件