title: Adding label to a single row in data frame in R
body: <p>I am currently trying to create a data frame from another data frame one row at a time. I am trying to rename the last row (as soon as it is added to the data frame) to a given value (stored in another list as <code>entry[1]</code>).</p>
  
  <p>Currently, I am using</p>
  
  <pre><code>a &lt;- rbind(a, choice)
  rownames(a)[nrow(a)] &lt;- entry[1] 
  </code></pre>
  
  <p>However, my output for this still has the rows labeled as a numeric list</p>
  
  <pre><code>  optOne optTwo Neither
  1  0     1     0
  2  1     0      0
  n 'count''count''count'
  </code></pre>
  
  <p>as opposed to</p>
  
  <pre><code>         optOne  optTwo  Neither
   cac1001  0      1       0
   f253     1      0       1
   'name'  'count' 'count' 'count'
  </code></pre>
  
  <p>I considered saving the name column as part of the actual data in its own column, but this was untenable because I need to be able to perform arithmetic on the actual data in my dataframe</p>
  
  <p>EDIT: Current output for rbind(a, choice) and relevant entryList[1] for the first 10 entries (I will list <code>entryList[1]</code> as an additional column):</p>
  
  <pre><code>     optOne    optTwo    Neither    entryList[1]
   1   1         0         0          cac1002
   2   1         0         0          cac101
   3   1         0         0          cac102
   4   1         0         0          cac1101
   5   1         0         0          cac1102
   6   1         0         0          cac201
   7   1         0         0          cac202
   8   0         1         0          cac301
   9   0         0         1          cac302
  10   1         0         0          cac402   
  </code></pre>
  
  <p>EDIT2: One thing that seems rather odd: parts of my code later on that rely on an if loop</p>
  
  <pre><code> if(entry[1] %in% rownames(a)) {
  </code></pre>
  
  <p>and they work correctly as if <code>entry[1]</code> was being added to rownames properly</p>