服务热线
178 0020 3020
任务一:
library("ggthemes")
library(ggplot2)
library(reshape)
data <- read.csv("D:/3/R2-3.1.csv", header = T)
data <- melt(data,id.vars ='Products',
measure.vars =c("Q1th", 'Q2nd', 'Q3rd','Q4th'))
graph1
ggplot(data, aes(x=variable, y=value, fill=Products))+
geom_bar(stat="identity", position="dodge", color= "black") +
labs(x="Time", y="Index")+ ggtitle("R2-31")+
scale_fill_wsj("rgby")+theme_wsj(color="blue")
任务二:
library("ggthemes")
library(ggplot2)
library(reshape)
data <- read.csv("D:/3/R2_3_2.csv", header = T)
ggplot(data, aes(社区, fill = 态度))+
geom_bar(position="stack") +
ggtitle("R2-31")+coord_flip()+
labs(x="count", y="社区")+
scale_fill_brewer(palette = "Pastel1")
附件