title: How to name the unnamed first column of a data.frame
body: <p>I have a data frame that looks like this: </p>
  
  <pre><code>&gt; mydf
                     val1     val2
  hsa-let-7a         2.139890 -0.03477569
  hsa-let-7b         2.102590  0.04108795
  hsa-let-7c         2.061705  0.02375882
  hsa-let-7d         1.938950 -0.04364545
  hsa-let-7e         1.889000 -0.10575235
  hsa-let-7f         2.264296  0.08465690
  </code></pre>
  
  <p>Note that from 3 columns only 2nd and 3rd are names. 
  What I want to do is to name the first column (plus rename the 2nd and 3rd).</p>
  
  <p>But why this command failed?</p>
  
  <pre><code>colnames(mydf) &lt;- c("COL1","VAL1","VAL2");
  </code></pre>
  
  <p>What's the right way to do it?</p>
  
  <p>It gave me:</p>
  
  <pre><code>Error in `colnames&lt;-`(`*tmp*`, value = c("COL1", "VAL1", "VAL2" :
    'names' attribute [3] must be the same length as the vector [2]
  </code></pre>