R2-39 第十期综合应用案例

redpanda 2018-01-09 05:45:25 阅读: 992

#Task1

library(ggplot2)

df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),

                  dose=rep(c("D0.5", "D1", "D2"),2),

                  len=c(6.8, 15, 33, 4.2, 10, 29.5))

head(df2)

p<-ggplot(df2, aes(x=dose, y=len, group=supp)) +

  geom_line(aes(color=supp))+

  geom_point(aes(color=supp))+ggtitle("R2-39")

p + scale_color_grey() + theme_classic()


#Task2

options(scipen=999)

library(ggplot2)

theme_set(theme_bw())

data("midwest", package = "ggplot2")

gg <- 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-39", 

       caption = "Source: midwest")

plot(gg)


#Task3

install.packages("RColorBrewer")

library(RColorBrewer)

nba <- read.csv(file.choose())

nba <- nba[order(nba$PTS),]

row.names(nba) <- nba$Name

nba <- nba[,2:20]

nba_matrix <- data.matrix(nba)

nba_heatmap <- heatmap(nba_matrix, Rowv=NA, Colv=NA, col = brewer.pal(9, "Blues"), scale="column", margins=c(5,10), main="R2-39")


 

 
邀请讨论

附件

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

微信服务号