title: R: Filtering rows of a factor according to a column
body: <p>I have a dataframe consisting of 2 columns:</p>
  <ul>
  <li>&quot;cells&quot; : factor with 3 levels</li>
  <li>&quot;values&quot;: numbers</li>
  </ul>
  <p>What I want do is, to filter all rows with the cell, which has at least one of its values smaller than a user-specified limit.</p>
  <p>Here is an example:</p>
  <pre><code>df &lt;- data.frame(&quot;cells&quot; = c(&quot;c1&quot;, &quot;c2&quot;,&quot;c3&quot;,&quot;c1&quot;,&quot;c1&quot;,&quot;c2&quot;,&quot;c3&quot;,&quot;c2&quot;),
                   &quot;values&quot; = c(3,4,5,2,5,5,1,6))
  df$cells &lt;- factor(df$cells, levels = c(&quot;c1&quot;, &quot;c2&quot;,&quot;c3&quot;))
  </code></pre>
  <p>The data-frame 'df' looks as shown below. If I set my limit to 1.5 then all rows having 'c3' in 'cells' column are to be removed because there is at least one value of 'c3' ('1' in 7th row), which is smaller than the limit, 2.5.</p>
  <p>One way of achieving this, would be to add a column of min-values for each different 'cells' value  (group_by(cells) and mutate). I am wondering if there would be a way to do it without adding a new column to the data-frame.</p>
  <p>Thank you.
  Ilhan</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">cells</th>
  <th style="text-align: center;">values</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">c1</td>
  <td style="text-align: center;">3</td>
  </tr>
  <tr>
  <td style="text-align: center;">c2</td>
  <td style="text-align: center;">4</td>
  </tr>
  <tr>
  <td style="text-align: center;">c3</td>
  <td style="text-align: center;">5</td>
  </tr>
  <tr>
  <td style="text-align: center;">c1</td>
  <td style="text-align: center;">2</td>
  </tr>
  <tr>
  <td style="text-align: center;">c1</td>
  <td style="text-align: center;">5</td>
  </tr>
  <tr>
  <td style="text-align: center;">c2</td>
  <td style="text-align: center;">5</td>
  </tr>
  <tr>
  <td style="text-align: center;">c3</td>
  <td style="text-align: center;">1</td>
  </tr>
  <tr>
  <td style="text-align: center;">c2</td>
  <td style="text-align: center;">6</td>
  </tr>
  </tbody>
  </table>
  </div>