楼主: 再找找
3445 0

[问答] 使用R做hetamap ,不能执行 ColSideColors' [推广有奖]

  • 0关注
  • 0粉丝

高中生

65%

还不是VIP/贵宾

-

威望
0
论坛币
380 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
889 点
帖子
8
精华
0
在线时间
48 小时
注册时间
2011-11-11
最后登录
2020-3-25

楼主
再找找 学生认证  发表于 2016-5-13 15:47:25 |AI写论文
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)
>
>

关键词:Deco Ecol side Dec ETA following library package orange color

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 01:18