服务热线
178 0020 3020
library("ggplot2") R1_data <- read.csv(file = "/Users/Adobe/Desktop/D/R/phase2/R2-1/data/R2-1-1.csv",header = T) head(R1_data) #查看数据的前几列 str(R1_data) R1_data <- na.omit(R1_data) p <- ggplot(R1_data,aes(x = A ,y = B ,color = SIZE)) + geom_line(shape = 2) + labs(x = "A gene expression" ,y = "B gene expression", title = "R2-05",caption = "It's really my work ,see my name,hahahahah") + xlim(-2,3) + ylim(-1,3) print(p)
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-05-Adobe") mytheme<- theme(panel.grid = element_blank(), panel.background=element_blank(), axis.text=element_blank(), axis.ticks = element_blank()) + theme(legend.position = "Right") data + mytheme
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 = "pink", high = "red") + xlab("Groups") + ggtitle("R2-05-Adobe")
附件