全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
3407 0
2016-05-13
悬赏 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)
>
>

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群