服务热线
178 0020 3020
> library(ggplot2)
> library(reshape2)
> library(plyr)
> library(scales)
> data<- read.csv(file.choose())
> data
ID CL CR DL DR
1 miR171 2.930737 3.228819 6.965784 9.643856
2 miR172 8.000000 7.303781 4.839204 5.726218
3 miR173 1.475733 3.616549 4.832890 9.118941
4 miR174 2.499846 4.562242 7.820179 7.820179
5 miR175 7.936638 7.988685 7.930737 10.113742
6 miR176 8.209453 9.353147 9.965784 11.132500
7 miR177 9.310613 3.805744 3.936638 9.214319
8 miR178 8.471675 2.092757 7.807355 10.942515
9 miR179 10.247928 2.864186 7.807355 13.149747
10 miR180 4.812177 7.807355 11.132500 9.912889
11 miR181 9.965784 2.044394 11.118941 10.807355
12 miR182 2.303781 2.507795 3.807355 7.977280
13 miR183 8.839204 6.965784 4.361944 5.813781
14 miR184 9.027906 2.861087 3.326429 10.287712
15 miR185 1.049849 9.804131 9.942515 6.388017
16 miR186 1.247928 2.936638 8.000000 8.800900
> mydata<- melt(data,id.vars=c("ID"))
> mydata2<-ddply(mydata,.(variable), transform,label=rescale(value))
ggplot(mydata2, aes(x=variable,y=ID))+geom_tile(aes(fill=label))+scale_fill_gradient(low = "yellow", high = "red")+xlab("Groups") + ggtitle("R2-28")+geom_text(aes(label=round(label,2)),size=4)
附件