title: R: `ID : Coercing LHS to a list` in adding an ID column, why?
body: <p>I have data </p>
  
  <pre><code>       N11.1 N22.2 N33.1 N44.1 N21.1 N31.1 N32.1
  Sinus      1     0     0   0.0     0     0  12.0
  ArrAHB     1     0     0   0.1     0     0  20.9
  </code></pre>
  
  <p>where I want to add an extra column <code>ID</code> with values <code>Sinus</code> and <code>ArrAHB</code>.</p>
  
  <pre><code>require(lattice)
  Sinus&lt;-c(1,0,0,0,0,0,12)
  ArrAHB&lt;-c(1,0,0,0.1,0,0,20.9)
  Labels&lt;-c("N11.1","N22.2","N33.1","N44.1","N21.1","N31.1","N32.1")
  ID&lt;-c("Sinus","Arr/AHB")
  data.female&lt;-data.frame(Sinus,ArrAHB,row.names=Labels)
  data.female&lt;-t(data.female)
  
  &gt; data.female$ID&lt;-ID
  
  Warning message:
  In data.female$ID &lt;- ID : Coercing LHS to a list
  </code></pre>
  
  <blockquote>
    <p><strong>Why does the creation of the ID column cause the coercion in the data.frame?</strong></p>
  </blockquote>
  
  <p><em>P.s. My goal is to get this data to the form like <a href="https://stackoverflow.com/a/22265066/164148">here</a> for <code>barchart(N11.1+N22.1+N33.1+N44.1+N21.1+N31.1+N32.1 ~ ID, data=data.female)</code> which requires a new ID column <a href="https://stackoverflow.com/q/40678499/164148">here</a>, I cannot understand why this ID addition sometimes works and sometimes not. Please explain.</em></p>