Graph for microarray data
1
0
Entering edit mode
Tim Smith ★ 1.1k
@tim-smith-1532
Last seen 9.6 years ago
Hi, I was trying to generate a heatmap with three colors (I have three values i.e, -1,0,1). I was using the following code (suggested earlier): ----------------------------------------------- r1 <- matrix(0:1,11,5) r2 <- matrix(-1:0,13,5) matr <- rbind(r1,r2) rownames(matr) <- LETTERS[1:nrow(matr)] colnames(matr) <- 1:5 heatmap(matr,col=c('green','black','red')) --------------------------------------------- What I want is for the -1 values to be green cells, 0 values to be black cells & 1 values to be red cells. However, I only seem to get red and green colors in the cell. What do I need to do to get this right? thanks! [[alternative HTML version deleted]]
• 821 views
ADD COMMENT
0
Entering edit mode
@stephen-henderson-71
Last seen 7.0 years ago
heatmap(matr,col=c('green','black','red'), scale='none') On 19 Sep 2008, at 13:24, Tim Smith wrote: > r1 <- matrix(0:1,11,5) > r2 <- matrix(-1:0,13,5) > matr <- rbind(r1,r2) > rownames(matr) <- LETTERS[1:nrow(matr)] > colnames(matr) <- 1:5 > heatmap(matr,col=c('green','black','red')) Stephen Henderson Viral Oncology (5th Floor) UCL Cancer Institute Paul O'Gorman Building Huntley Street London, WC1E 6BT s.henderson at ucl.ac.uk +44 (0) 207 679 6827
ADD COMMENT

Login before adding your answer.

Traffic: 471 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6