title: R using ignoring NA's when using unique
body: <p>I am attempting to find/discard rows based on their similarity in column values and have the following example code:</p>
  
  <pre><code>vec1 &lt;- c("B","D","E","NA")    
  vec2 &lt;- c("B","D","E","NA")    
  vec3 &lt;- c("B","C","E","NA")    
  vec4 &lt;- c("B","D","E","NA")    
  vec5 &lt;- c("B","NA","E","E")    
  vec6 &lt;- c("B","NA","NA","NA")
  
  mat1 &lt;- cbind(vec1,vec2,vec3,vec4,vec5,vec6)
  mat1
       vec1 vec2 vec3 vec4 vec5 vec6
  [1,] "B"  "B"  "B"  "B"  "B"  "B" 
  [2,] "D"  "D"  "C"  "D"  "NA" "NA"
  [3,] "E"  "E"  "E"  "E"  "E"  "NA"
  [4,] "NA" "NA" "NA" "NA" "E"  "NA"
  
  rows = apply(mat1, 1, function(i) length(unique(i)) &gt; 1 )
  mat2 &lt;- mat1[rows, ]
       vec1 vec2 vec3 vec4 vec5 vec6
  [1,] "D"  "D"  "C"  "D"  "NA" "NA"
  [2,] "E"  "E"  "E"  "E"  "E"  "NA
  [3,] "NA" "NA" "NA" "NA" "E"  "NA"
  </code></pre>
  
  <p>How may I change the code above to achieve this? In the help file for <code>unique</code> it suggests there is an <code>incomparables</code> argument, is this implemented and can it be used? I don't necessarily wish to remove the <code>NA</code>'s just ignore them.</p>