服务热线
178 0020 3020
Part1
library(ggplot2)
library(reshape2)
library(ggthemes)
data<-read.csv(file.choose(),header = T)
data2<-melt(data,id.vars='Products',measure.vars=c("Q1th", 'Q2nd', 'Q3rd','Q4th'), variable.name ="Time", value.name = 'Index')
ggplot(data2, aes(x=Time, y= Index, fill = Products))+geom_bar(stat="identity", position="dodge",alpha = 0.8) +labs(x="Time", y="Index")+ ggtitle("R2-06-dean")+scale_fill_wsj("rgby")+theme_economist()
Part2
library(ggplot2)
library(reshape2)
library(ggthemes)
data<-read.csv(file.choose(),header = T)
ggplot(data,aes(社区,fill=态度))+geom_bar(position="stack")+ggtitle("R2-06-dean")+labs(x="社区",y="count")+coord_flip()
附件