Hello all, I tried to generate a heatmap using heatmap.2 The following code was used:
<code>heatmap.2(as.matrix(sample_dist), key=F, trace="none",Colv = c("cancer", "normal"),Rowv ="Colv",dendrogram= "none",col=colorpanel(100, "black", "white"),ColSideColors=myColors[condn], RowSideColors=myColors[condn],margin=c(10, 10), main="Sample Distance Matrix")
Then, I got this error:
<code>Error in heatmap.2(as.matrix(sample_dist), key = F, trace = "none", Colv = c("cancer", : 'ColSideColors' must be a character vector of length ncol(x)
Does this mean that "myColors" is not same as "condn"?
This was how i defined myColors and "condn"
<code>myColors<- brewer.pal(8, "Set3")[1:length(unique(group))]
<code>condn<- factor(c(rep("normal",3), rep("cancer",3)))
where, am I getting it wrong?
Regards, Anthony
Hello Kelvin, pardon my formatting style. I am still learning it