Hi all, I have a matrix with values between 0 and 1. I want to plot this matrix on a heat map so anything >0.05 is blue, anything <=0.05 and >0.01 is yellow, and anything else is grey. I am using the heatmap.2 function. I searched around but did not find an efficient way to set colour ranges as I described. Could anybody give some hints? Thank you in advance. Wendy -- View this message in context: http://r.789695.n4.nabble.com/set-heatmap-2-color-ranges-tp4425166p4425166.html Sent from the R help mailing list archive at Nabble.com.
set heatmap.2 color ranges
3 messages · wendy, David Winsemius
On Feb 27, 2012, at 11:26 AM, Wendy wrote:
0.05 is blue, anything <=0.05 and >0.01 is yellow, and
anything else is grey
No data structures offered, but this may be a useful example:
col= c(""grey", "yellow", blue")[findInterval(X, c(-.01, 0.01, 0.05,
1.1))]
David Winsemius, MD Heritage Laboratories West Hartford, CT
On Feb 27, 2012, at 1:32 PM, David Winsemius wrote:
On Feb 27, 2012, at 11:26 AM, Wendy wrote:
0.05 is blue, anything <=0.05 and >0.01 is yellow, and
anything else is grey
No data structures offered, but this may be a useful example:
col= c(""grey", "yellow", blue")[findInterval(X, c(-.01, 0.01,
0.05, 1.1))]
Except you would want to have matching '"''s
col= c(""grey", "yellow", "blue")[findInterval(X, c(-.01, 0.01, 0.05,
1.1))]
Why are these things easier to see when they show in "Received"?
-- David Winsemius, MD Heritage Laboratories West Hartford, CT
______________________________________________ R-help at r-project.org mailing list 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.
David Winsemius, MD Heritage Laboratories West Hartford, CT