[R] heatmap plot

Markus Mühlbacher muehliman at yahoo.com
Mon Jul 20 17:38:29 CEST 2009


Dear R community!

I am trying to create a heatmap based on the following data. As you can see the diagonal (0,0 to 10,10) is always 0). If I run the heatmap command like i posted it I get a graph with horizontal lines. 

What is my mistake?

> heatmap(activity.matrix, Rowv = NA, Colv = NA, scale="column", xlab="x Compounds", ylab="y Compounds", col=topo.colors(100))
> activity.matrix
            [,1]       [,2]       [,3]        [,4]      [,5]       [,6]
 [1,]  0.0000000 -0.1017802  0.3635007  0.62522118 0.8869417 -0.4652809
 [2,]  0.1017802  0.0000000  0.4652809  0.72700138 0.9887219 -0.3635007
 [3,] -0.3635007 -0.4652809  0.0000000  0.26172050 0.5234410 -0.8287816
 [4,] -0.6252212 -0.7270014 -0.2617205  0.00000000 0.2617205 -1.0905021
 [5,] -0.8869417 -0.9887219 -0.5234410 -0.26172050 0.0000000 -1.3522226
 [6,]  0.4652809  0.3635007  0.8287816  1.09050206 1.3522226  0.0000000
 [7,] -0.2471805 -0.3489607  0.1163202  0.37804072 0.6397612 -0.7124613
 [8,]  1.0032619  0.9014817  1.3667626  1.62848308 1.8902036  0.5379810
 [9,] -0.6833813 -0.7851615 -0.3198806 -0.05816011 0.2035604 -1.1486622
[10,]  1.0759620  0.9741818  1.4394627  1.70118322 1.9629037  0.6106812
            [,7]        [,8]        [,9]       [,10]
 [1,]  0.2471805 -1.00326190  0.68338129 -1.07596204
 [2,]  0.3489607 -0.90148171  0.78516149 -0.97418184
 [3,] -0.1163202 -1.36676259  0.31988061 -1.43946272
 [4,] -0.3780407 -1.62848308  0.05816011 -1.70118322
 [5,] -0.6397612 -1.89020358 -0.20356039 -1.96290371
 [6,]  0.7124613 -0.53798102  1.14866217 -0.61068116
 [7,]  0.0000000 -1.25044237  0.43620083 -1.32314250
 [8,]  1.2504424  0.00000000  1.68664319 -0.07270014
 [9,] -0.4362008 -1.68664319  0.00000000 -1.75934333
[10,]  1.3231425  0.07270014  1.75934333  0.00000000

Thanks in advance. 

Greets, 
Markus







More information about the R-help mailing list