服务热线
178 0020 3020
任务1
install.packages('ggthemes')
install.packages('ggplot2')
install.packages('ggthemes')
library("ggplot2")
library("reshape2")
library("ggthemes")
d1<-read.csv("R2-3.1.csv")
d1<-melt(d1,id.vars='Products',measure.vars=c("Q1th","Q2nd","Q3rd","Q4th"))
ggplot(d1,aes(x=variable,y=value,fill=Products))+geom_bar(stat="identity",position="dodge",color="black")+labs(x="Time",y="Index")+ggtitle("R2-01")+scale_fill_wsj("rgby")+theme_wsj(base_size=7,color="blue")
任务2
d2<-read.csv("R2_3_2.csv")
ggplot(d2,aes(社区,fill=态度))+geom_bar(position="stack")+ggtitle("R2-01")+labs(x="社区",y="count")+coord_flip()
附件