R2-04 第十期 混乱搭配作业

blanking 2018-01-09 17:44:43 阅读: 1137

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))

R2-10-1.png


R2-10-2.png


R2-10-3.png


 
邀请讨论

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
{{item.nick_name}} 受邀请回答 {{item.create_time}}
{{item.refer_comment.nick_name}} {{item.refer_comment.create_time}}

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
切换到完整回复 发送回复
赞({{item.count_zan}}) 踩({{item.count_cai}}) 删除 回复 关闭
科研狗©2015-2024 科研好助手,京ICP备20005780号-1 建议意见

服务热线

178 0020 3020

微信服务号