title: removing rows that belong to only one group in a tidy data frame
body: <p>I have a data frame that looks like this:</p>
  
  <pre><code>value=c(1,2,6,4,5,6)
  
  group=c(rep('A',3),rep('B',3))
  
  mydata=data.frame(value,group)
  </code></pre>
  
  <p>I want to retain all values in group A and all values less than 6 in group B.  That is, I need to end up with something like this:</p>
  
  <pre><code>value=c(1,2,6,4,5)
  
  group=c(rep('A',3),rep('B',2))
  </code></pre>
  
  <p>What I've done so far is to filter group A as is. Filter group B with value &lt;6 and combine the two data frames into one.  Is there a better way to do this using dplyr or any other function?</p>