Dear all,

I was wondering if you could help me to construct a heat map, in which the
columns are sorted by sample type (A first and then B).
My reproducible example below runs, but the columns of the heatmap are not
organized in the way I would like because it has first sampleA, SampleB,
sampleA, and then sampleB.


A = matrix(rnorm(20), 5,8)
A
colnames(A) <- c ("Sample1.A", "Sample2.B", "Sample3.A", "Sample4.B",
"Sample5.A", "Sample6.B", "Sample7.A", "Sample8.B")
A
rownames(A) <- c ("protein1","protein2", "protein3", "protein4","protein5")
A

heatmap.2(A, dendrogram="col", Rowv = colnames(A), tracecol =
NA,col=bluered(64), sub = "",
          distfun = function(y) dist(y, method = "euclidean"), hclustfun =
function(y) hclust(y, method = "median"),
          scale = "row",cexCol = 1, cexRow = 0.9, ylab = "Enzymes", xlab =
"Samples", margins = c(9,9), keysize = 1,
          main='Test')



​Thanks.

-- 
Andre

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to