Dear bioconductors,
>From a google search, I found the following code that confuses me a little.
As usual, it is probably something really elementary but reading around does
not solve.

The code was written by James Mcdonald (
http://www.mail-archive.com/r-help@r-project.org/msg61514.html) and is to
compute dendograms based on correlation and plot the results on a heatmap as
follows;

a <- matrix(rnorm(50), ncol=5)
rowv <- as.dendrogram(hclust(as.dist(1-cor(t(a)))))
colv <- as.dendrogram(hclust(as.dist(1-cor(a))))
heatmap.2(a, scale="row", Rowv=rowv, Colv=colv)


Why the *1*-cor(a)?


Orig.cor Adjusted cor	
1	0
0.9	0.1
0.8	0.2
0.7	0.3
0.6	0.4
0.5	0.5
0.4	0.6
0.3	0.7
0.2	0.8
0.1	0.9
0	1
-0.1	1.1
-0.2	1.2
-0.3	1.3
-0.4	1.4
-0.5	1.5
-0.6	1.6
-0.7	1.7
-0.8	1.8
-0.9	1.9
-1	2


This removes negative numbers? What is the reason for doing this?

	[[alternative HTML version deleted]]

