title: Subsetting R data frame results in mysterious NA rows
body: <p>I've been encountering what I think is a bug.  It's not a big deal, but I'm curious if anyone else has seen this.  Unfortunately, my data is confidential, so I have to make up an example, and it's not going to be very helpful.</p>
  
  <p>When subsetting my data, I occassionally get mysterious NA rows that aren't in my original data frame.  Even the rownames are NA.  EG:</p>
  
  <pre><code>example &lt;- data.frame("var1"=c("A", "B", "A"), "var2"=c("X", "Y", "Z"))
  example
  
    var1 var2
  1    A    X
  2    B    Y
  3    A    Z
  </code></pre>
  
  <p>then I run:</p>
  
  <pre><code>example[example$var1=="A",]
  
    var1 var2
  1    A    X
  3    A    Z
  NA&lt;NA&gt; &lt;NA&gt;
  </code></pre>
  
  <p>Of course, the example above does not actually give you this mysterious NA row; I am adding it here to illustrate the problem I'm having with my data.</p>
  
  <p>Maybe it has to do with the fact that I'm importing my original data set using <a href="http://cran.r-project.org/web/packages/xlsx/xlsx.pdf">Google's read.xlsx package </a> and then executing wide to long reshape before subsetting.</p>
  
  <p>Thanks</p>