title: When subsetting rows with a factor with equal (==), NA's are also included. It doesn't happen with %in%. Is it normal?
body: <p>Suppose I have a factor A with 3 levels A1, A2, A3 and with NA's. Each appears in 10 cases, so there is a total of 40 cases. If I do</p>
  
  <pre><code>subset1 &lt;- df[df$A=="A1",]  
  dim(subset1)  # 20, i.e., 10 for A1 and 10 for NA's
  summary(subset1$A) # both A1 and NA have non-zero counts
  subset2 &lt;- df[df$A %in% c("A1"),] 
  dim(subset2)  # 10, as expected
  summary(subset2$A) # only A1 has non-zero count
  </code></pre>
  
  <p>And it is the same whether the class of the variable used for subsetting is factor or integer. Is it just how equal (and >, &lt;) works? So should I just stick to <code>%in%</code> for factors and always include <code>!is.na</code> when using equal? Thanks!</p>