title: Split data frame conditional on factor level summarise based on duplicated values using dplyr
body: <p>I have a dataframe like so: </p>
  
  <pre><code>df&lt;- data.frame(region= c("1","1","1","1","1","1","1","1","2","2"), 
    loc=c("A","A","A","B","B","B","C","D","E","F"), sp1= 
  c("a","a","b","a","e","e","e","e","a","a"), sp2= 
  c("b","b","c","b","f","f","f","f","b","b"), inter= 
  c("a_b","a_b","b_c","a_b","e_f","e_f","e_f","e_f","a_b","a_b"))
  </code></pre>
  
  <p>I wish to group by <code>region</code> to find each the duplicate levels <code>inter</code>  among <code>loc</code> within the region and then count of how many plots it occurred in.  The output dataframe should appear as follows:</p>
  
  <pre><code>df&lt;- data.frame(region= c("1","1","2"), sp1= 
   c("a","e","a"), sp2= 
   c("b","f","b"), inter= 
   c("a_b","e_f","a_b"), freq=c("2","3","2"))
  </code></pre>
  
  <p>I have tried the following: </p>
  
  <pre><code>df %&gt;%
  group_by(region,inter) %&gt;%
  filter(duplicated(inter))
  </code></pre>