title: R extracting non-missing data
body: <p>I have a dataframe:</p>
  
  <pre><code>a&lt;-c(1,2,3)
  b&lt;-c("CarA","CarB",NA)
  data&lt;-data.frame(a,b)
  
  data
  
      a    b
    1 1 CarA
    2 2 CarB
    3 3   NA
  </code></pre>
  
  <p>Now I want to remove the row with missing data (NA).</p>
  
  <p>But this does not work:</p>
  
  <pre><code>data&lt;-data[data[,2]!=NA,]
  </code></pre>
  
  <p>My thinking here is to look at the second column [,2] and look for those that don't have NA.  Then extract the remaining data.  Would someone be able to tell me what went wrong here?</p>