title: data.frame into matrix (R) , rownames() error
body: <p>I have a data.frame ("data.csv") of 93 x 28 I want to convert into matrix for further plotting, it looks like this:</p>
  
  <pre><code>SYMBOL  BT.20   CAL.51  MDA.MB.436  BT.549
  A   3.039   4.908   3.865   3.818
  B   4.349   5.399   6.071   5.313
  C   7.509   8.091   6.48    6.660
  D   3.429   4.394   3.622   3.873
  E   3.369   6.716   3.557   3.346
  </code></pre>
  
  <p>the code</p>
  
  <pre><code>data &lt;- read_csv("data.csv")
  rnames &lt;- data[,1]              # assign labels in column 1 to "rnames"  
  mat_data &lt;- data.matrix(data[,2:28])  # transform column 2 - end into a matrix
  rownames(mat_data) &lt;- rnames                  # assign row names
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>ERROR: Error in `rownames&lt;-`(`*tmp*`, value = list(SYMBOL = c("A", "B",  : 
    length of 'dimnames' [1] not equal to array extent
  </code></pre>
  
  <p>column 1 doesn't have duplicate names or missing values</p>
  
  <p>edit:
  with  <code>read.csv()</code>  instead, it works just fine</p>