I used the function heatmap.2 some times ago, and it worked as intended (for
me...). I tried to reuse my old R program and I encounter some trouble. I
suppose that something was changed in newer versions.

One of the examples given in the help page shows the same problem :

-------------- this part wa
 ## For variable clustering, rather use distance based on cor():
data(USJudgeRatings)
symnum( cU <- cor(USJudgeRatings) )

hU <- heatmap.2(cU, Rowv=FALSE, symm=TRUE, col=topo.colors(16),
              distfun=function(c) as.dist(1 - c), trace="none")

## The Correlation matrix with same reordering:
hM <- format(round(cU[hU[[1]], hU[[2]]], 2))
hM

# now with the correlation matrix on the plot itself

heatmap.2(cU, Rowv=FALSE, symm=TRUE, col=rev(heat.colors(16)),
             distfun=function(c) as.dist(1 - c), trace="none",
             cellnote=hM)

When running this correlation values are supposed to appear on the plot.
But, as one can see in this example, the same value is not associated with
the same color ( sometimes 1.00 is red or pale yellow).
Looks like some reordering done on colors was'nt done on cellnotes.

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to