服务热线
178 0020 3020
library(ggplot2)
library(RColorBrewer)
#任务1
mytheme <- theme_classic()+theme(panel.grid.major = element_blank())
R10_1 <- read.csv("/Users/taowang/documents/R/R2/R2-10/R10_1.csv",header = T)
R10_1
ggplot(R10_1,aes(x=Group, y = value, color = Gene))+
geom_line()+
geom_point()+
geom_errorbar(aes(ymin= value-bar,ymax = value+bar))+
ggtitle("R2-04")+
mytheme
#任务2
head(midwest)
ggplot(midwest,aes(x=area,y=poptotal))+
geom_point(aes(col= state, size= popdensity))+
geom_smooth(method = 'loess',se=F)+
xlim(c(0,0.1))+
ylim(c(0,500000))+
labs(title="R2-04",subtitle= "Area Vs Population",
x = "Area",
y = "Population",
caption = "Source: midwest")+
mytheme
#任务3
R10_3 <- read.csv("/Users/taowang/documents/R/R2/R2-10/task3.csv",header = T)
head(R10_3)
row.names(R10_3) <- R10_3$Name
head(R10_3)
R10_3 <- R10_3[,-1]
head(R10_3)
R10_3 <- data.matrix(R10_3)
heatmap(R10_3,Rowv = NA, Colv = NA, col = brewer.pal(9,"Blues"), scale="column", margins=c(5,10))
附件