R2-06 第十期综合

dean 2018-01-09 22:26:50 阅读: 1096

part1


library(ggplot2)

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

ggplot(data,aes(x=Day,y=Weight,group=Number))+

  geom_line()+

  geom_point(size=3,aes(colour=Number))+xlab("Time")+ylab("Weight")+

  xlim(0,8)+ylim(16,22)+labs(title="R2-06-dean")

  

10-1.png


part2


library(ggplot2)

data<-ggplot(midwest,aes(x=area,y=poptotal))+

  geom_point(aes(col=state,size=popdensity))+

  geom_smooth(method='loess')+xlim(c(0,0.1))+ylim(c(0,500000))+

  labs(title="R2-06-dean")

mytheme<- theme(panel.grid = element_blank(), panel.background=element_blank(),axis.text=element_blank(),axis.ticks = element_blank())+theme(legend.position = "bottom")

data+mytheme

10-2.png


part3


library(reshape2)

library(scales)

library(plyr)

library(ggplot2)


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


data2<-melt(data,id.vars=c("Name"))


data3<-ddply(data2,.(variable), transform,label=rescale(value))


ggplot(data3, aes(x=variable,y=Name))+geom_tile(aes(fill=label))+scale_fill_gradient(low = "white", high = "blue")+xlab("Groups") +

  ggtitle("R2-06-dean")

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

微信服务号