title: heatmap in R, duplicate names in rows
body: <p>I am programming a heatmap in R based on a csv file. This contains the following information:</p>
  
  <pre><code>NAME,metformin,metformin,phenformin,phenyl biguanide,metformin,estradiol
  Adenocarcinoma of lung,0,0,0,-1.834006462,1.715939688,0
  Adenocarcinoma of lung,1.995916353,0,0,0,0,0
  Thymic carcinoma,1.154056722,1.106488961,0,1.145126548,0,-1.14095315
  alpha-1-Antitrypsin deficiency,0,0,0,0,-1.917025669,-1.974151858
  </code></pre>
  
  <p>So I want to create a heatmap in which in the name of the rows appears the labels: Adenocarcinoma of the lung, Adenocarcinoma... etc. I am doing this steps:</p>
  
  <pre><code>hm&lt;-read.csv("heatmap1.csv",sep=",")
  row.names(hm)&lt;-hm$NAME
  hm&lt;-hm[,2:7]
  hm_matrix&lt;-data.matrix(hm)
  heatM&lt;-heatmap(hm_matrix, Rowv=NA, Colv=NA, col = cm.colors(256), scale="column", margins=c(5,10))
  </code></pre>
  
  <p>The problem I got is in the line that says:</p>
  
  <pre><code>row.names(hm)&lt;-hm$NAME
  
  Error in `row.names&lt;-.data.frame`(`*tmp*`, value = c(1L, 1L, 3L, 2L)) : 
    duplicate 'row.names' are not allowed
  </code></pre>
  
  <p>I know that I have a duplicated name, but I really need that data appears in the heatmap because the measure levels (the quantities) are different even if they are from the same disease.</p>
  
  <p>Thanks for the help</p>