服务热线
178 0020 3020
R2-25
3.1
setwd("D:/R language/R2/R2.3")
library("ggthemes")
library(ggplot2)
library(reshape)
data <- read.csv("R2-3.1.csv", header = T)
data <- melt(data,id.vars ='Products',measure.vars =c("Q1th", 'Q2nd', 'Q3rd','Q4th'))
ggplot(data, aes(x=variable, y=value, fill=Products))+
geom_bar(stat="identity", position="dodge", color= "black") +
labs(x="Time", y="Index")+ ggtitle("R2-25")+
scale_fill_wsj("rgby")+theme_economist()
3.2
data2 <- read.csv("R2_3_2.csv")
ggplot()+geom_bar(data=data2,aes(x=社区,fill=态度),position="stack")+coord_flip()+ggtitle("R-25")+theme(plot.title=element_text(hjust=0.5))
附件