悬赏 2 个论坛币 未解决
> data0 = read.table("F:/代码/zhou.txt", header=T,row.names=1)#必须加上row.names=1
> data = data0[,-1]
> rownames(data) = data0[,1]
> library(gplots)
Attaching package: ‘gplots’
The following object is masked from ‘package:stats’:
lowess
> heatmap.2(as.matrix(data))
> library(RColorBrewer)
> color = c(rep("orange",3),rep("blue",3))
> heatmap.2(as.matrix(data),col = greenred(75),
+ scale = "row",dendrogram = 'both',
+ key = TRUE, symkey = FALSE, density.info = "none",
+ trace = "none", cexRow = 0.5,
+ main = "Heatmap",
+ ColSideColors = as.character(color) #ColSideColors就按照样本读入的顺序分配颜色
+ )
Error in heatmap.2(as.matrix(data), col = greenred(75), scale = "row", :
'ColSideColors' must be a character vector of length ncol(x)
>
>