title: How to set the row index name in R? (Like DF.index.name in Pandas)
body: <p><strong>How can I set the row index name in a <code>R</code> <code>data.frame</code> object?</strong> </p>
  
  <p>I tried looking on stackoverflow for the answer but I couldn't figure out how to even search for it? <a href="https://stackoverflow.com/search?q=set+row+index+name+dataframe+R">https://stackoverflow.com/search?q=set+row+index+name+dataframe+R</a></p>
  
  <p>This one kind of explains it but they are converting it to a matrix? 
  <a href="https://stackoverflow.com/questions/17514648/how-do-i-name-the-row-names-column-in-r">How do I name the &quot;row names&quot; column in r</a></p>
  
  <pre><code>&gt; dimnames(DF_c) = c("sample","cluster")
  Error in `dimnames&lt;-.data.frame`(`*tmp*`, value = c("sample", "cluster" : 
    invalid 'dimnames' given for data frame
  </code></pre>
  
  <p>In Python <code>Pandas</code>, I would simply do <code>DF_c.index.name = "samples"</code> but I don't know how to do it in <code>R</code>.  I noticed that when I saved it <code>write.table(DF_c, "output.tsv", sep="\t")</code> It puts my column label as the row name but I can't do something like <code>colnames(DF_c) = c( "samples","cluster")</code> since there is only 1 column? </p>
  
  <pre><code># Clusters
  DF_c = data.frame(last_iter$c)
  rownames(DF_c) = row_labels
  colnames(DF_c) = c( "cluster")
  </code></pre>
  
  <p>Bonus:
  How to not include the <code>"</code> when it's writing table to output?</p>
  
  <p><a href="https://i.stack.imgur.com/SlF8Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlF8Q.png" alt="enter image description here"></a></p>