title: Filter groups of df when each row of group fulfills the condition in at least N columns
body: <p>I have a small trouble with my df. Firstly I'll show you an example, then explain what I'd like to recieve.</p>
  
  <p>My input df:</p>
  
  <pre><code>C1  C2  C3  C4  C5  C6  C7  C8
  A   I   I   D   X   I   I   I
  A   I   I   I   X   D   I   I
  A   I   I   I   X   I   I   I
  A   I   D   I   X   NC  I   I
  B   D   D   I   X   I   I   I
  B   D   I   NC  X   I   I   D
  C   NC  I   I   X   NC  D   I
  C   I   I   I   X   I   I   I
  C   I   I   I   X   I   I   D
  D   NC  NC  I   X   D   D   D
  D   I   I   I   X   D   D   I
  D   D   D   I   X   I   I   NC
  D   I   I   I   X   NC  I   I
  E   NC  I   I   X   I   I   D
  E   I   I   I   X   I   D   D
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>C1  C2  C3  C4  C5  C6  C7  C8
  A   I   I   D   X   I   I   I
  A   I   I   I   X   D   I   I
  A   I   I   I   X   I   I   I
  A   I   D   I   X   NC  I   I
  </code></pre>
  
  <p>I'd like to have only groups (<code>group by column 'C1'</code>) (with all rows) where there're <strong>at least 2</strong> occurances of <code>'I'</code> in each row of group (let's take <code>A</code>) in group columns <code>C2, C3, C4</code> <strong>and</strong> <code>C6, C7, C8</code>.</p>
  
  <p>I decided to use <code>filter()</code>, <code>all()</code> and <code>rowSums()</code></p>
  
  <pre><code> df_filtered &lt;- df %&gt;%
    group_by(C1) %&gt;%
    filter(all(rowSums(df[,2:4] == 'I' &amp; df[,6:8] == 'I') &gt;= 2))
  </code></pre>
  
  <p>wht doesn't it work? It returns 0 rows, no idea why... </p>