R2-07-第十期 -综合案例

Bamboo 2018-01-09 21:48:16 阅读: 1188

> getwd()

[1] "C:/Users/Administrator/Desktop/R语言"

> library(ggplot2)

 a<-read.csv("R2-10.csv")

ggplot(a, aes(Time,value,color =SIZE,shape = SIZE))+geom_line(color = "black")+geom_point(size=4)+ ggtitle("R2-07")

1.jpg

因为之前没有找到合适的数据,只能用第一期的数据交作业了,原谅我!



TASK  two

> 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-07", caption = "Source: midwest")

> plot(gg)



2.jpg

Task  three:


 library(RColorBrewer)

> getwd()

[1] "C:/Users/Administrator/Desktop/R语言"

> a<-read.csv("task3.csv")

> a <- a[order(a$PTS),]

> row.names(a) <- a$Name

> a <- a[,2:20]

> a_matrix <- data.matrix(a)


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


3.jpg

 
邀请讨论

附件

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

微信服务号