title: Write a function that can ignore specific filter parameters in R
body: <p>I want to write a function with several inputs.<br>
  Each input adjusts a particular filter parameter in a dplyr pipeline.</p>
  
  <p>I am struggling with how to turn on/off the grep parameter,<br>
  that is, I want to have the ability to completely ignore the grep line</p>
  
  <p>My dataframe (df), has three variables (sent, repeat, cases)</p>
  
  <p>Here is my function:</p>
  
  <pre><code>my_filter &lt;- function(df, a, b, c){ 
  
  df &lt;&lt;- df %&gt;%
            filter(sent != a,
                  repeat != b,
                   !grepl("_v", cases)) 
  }
  </code></pre>
  
  <p>I would like the "c" argument to allow me to ignore the last line in the pipeline !grepl("_v", cases)<br>
  how do I set "c" such that it controls the presence/absence of that line?</p>