title: How to filter dataframe with multiple conditions?
body: <p>I have this dataframe that I'll like to subset (if possible, with <code>dplyr</code> or <code>base R</code> functions): </p>
  
  <pre><code>df &lt;- data.frame(x = c(1,1,1,2,2,2), y = c(30,10,8,10,18,5))
  
  x  y
  1 30
  1 10
  1  8
  2 10
  2 18
  2  5
  </code></pre>
  
  <p>Assuming x are factors (so 2 conditions/levels), how can I subset/filter this dataframe so that I get only <code>df$y</code> values that are greater than 15 for <code>df$x == 1</code>, and <code>df$y</code> values that are greater than 5 for <code>df$x == 2</code>? </p>
  
  <p>This is what I'd like to get:</p>
  
  <pre><code>df2 &lt;- data.frame(x = c(1,2,2), y = c(30,10,18))
  
  x y
  1 30
  2 10
  2 18
  </code></pre>
  
  <p>Appreciate any help! Thanks!</p>