title: Iteratively adding a row containing characters and numbers to a dataframe
body: <p>I have a <code>list</code> containing named elements. I am iterating over the list names, performing the computation for each corresponding element, &quot;encapsulating&quot; the results and the name in a vector and finally adding the vector to a table. The row or vector after each iteration contains a mix of characters and numbers.
  The first row is getting added but from the second row onwards there is a problem.
  In this example, there is supposed to be one column (first) containing alphanumeric names. All rows after the first one contain NAs.</p>
  <pre><code>x &lt;- list(a_1=c(1,2,3), b_2=c(3,4,5), c_3=c(5,1,9))
  
  df &lt;- data.frame()
  for(name in names(x))
  {
    tmp &lt;- x[[name]]
    m &lt;- mean(tmp)
    s &lt;- sum(tmp)
    df &lt;- rbind(df, c(name,m,s))
  }
  
  df &lt;- as.data.frame(df)
  </code></pre>
  <p>I know there are possibly more efficient ways but for the moment this is more intuitive for me as it is assuring that each computation is associated with a particular name. There can be several columns and rows and the names are extremely helpful to join tables, query, compare etc. They make it easier to trace back results to a particular element in my original list.</p>
  <p>Additionally, I would be glad to know other ways in which the element names are always retained while transforming.</p>
  <p>Thankyou!</p>