R2-12-综合案例

pcr狗 2018-01-08 21:14:04 阅读: 968

#task1

library(ggplot2)

point<-read.table("line.csv",header = T,sep = ",")

pline <- ggplot(point,aes(x=YEAR,y=POINT,color=PLAYER))+

  geom_point(aes(shape=PLAYER))+

  geom_line()+

  theme(panel.background = element_rect(fill = "white"),

        axis.line = element_line(colour = "grey50"),

        legend.justification = "top")+

  ggtitle("R2-12-Kobe vs James")

pline


#task2

options(scipen = 999)

theme_set(theme_bw())

p2<-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(subtitle="Area Vs Population",

       y="Population",

       x="Area",

       title="R2-12",

       caption="Source:midwet")

p2


#task3

heat_text<-read.table("task3.csv",header = T,sep = ",")

head(heat_text)

row.names(heat_text)<-heat_text$Name

head(heat_text)

heat_text<-heat_text[1:45,2:21]

head(heat_text)

heat_m<-data.matrix(heat_text)

library(pheatmap)

pheatmap(heat_m,scale = "column",

         cluster_rows = F,cluster_cols = FALSE,legend = F)

t1.png

t2.png

t3.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

微信服务号