title: R: Reducing data frame to rows that fully match across two columns
body: <p>This may be a repeat, but I've used all sorts of different keywords trying to find an answer to this and have failed. What I want to do is remove all instances of non-matches across multiple columns from a data frame:</p>
  
  <pre><code>id = c(1,1,1,2,2,3,3,4,5,5)
  type = c("a", "a", "b", "b", "b", "a", "b", "b", "a", "a")
  df = data.frame(id,type)
  
  
     id type
  
  1   1    a
  2   1    a
  3   1    b
  4   2    b
  5   2    b
  6   3    a
  7   3    b
  8   4    b
  9   5    a
  10  5    a
  </code></pre>
  
  <p>In this case, I want to only keep the rows that are full matches across each ID, so my output should be</p>
  
  <pre><code>    id type
  4   2    b
  5   2    b
  8   4    b 
  9   5    a
  10  5    a   
  </code></pre>
  
  <p>Thanks in advance to anybody that can help me out here!</p>