title: R column name in an object is being replaced by the object name
body: <p>Below is a code I am using to read an xml file and create a data frame out of the attributes in the xml file. However, I am small issue with the code. <a href="http://www.filedropper.com/plans_1" rel="nofollow">Here</a> is a sample for the data.</p>
  
  <p>When I convert the first list named <code>attribact</code> into a dataframe named <code>k1</code>, the column named <code>x</code> in the list is changed to <code>k1</code>. The same thing happens with the last line of the code <code>data1 &lt;- cbind(k1,k2)</code>. Here, the column name <code>k1</code> (from earlier step) is changed to <code>data1</code>  In other words, one of the column names in the list is being replaced by the object name the list is being assigned to.</p>
  
  <pre><code>plans &lt;- xmlParse(file1)
  idNodes &lt;- getNodeSet(plans, "//person[@id]")
  ids &lt;- lapply(idNodes, function(x) xmlAttrs(x)['id'])
  attribact &lt;- vector("list", length(ids)*14)
  k &lt;- 1
  for (i in 1:length(ids))
  {
    act &lt;- xpathApply(idNodes[[i]], path = paste("//person[@id=", as.numeric(ids[[i]]),"]//plan[@selected='yes']//act|leg", sep=""), xmlAttrs)
    for (j in 1:length(act))
    {
      attribact[[k]] &lt;- c(act[[j]],ids[[i]])
      k &lt;- k+1    
    }
  }
  attribact &lt;- attribact[attribact!='NULL']
  k1 &lt;- t(as.data.frame(attribact))
  data1 &lt;- k1
  </code></pre>