title: Is there a more efficient way of using dplyr filter to remove rows from a dataframe?
body: <p>I have a large dataframe from which I wish to remove some subjects (all subjects in procedure 2 where subject ID is "4")</p>
  
  <p>Example (and cut down) dataset is here: <a href="http://pastebin.com/raw/Dz6xxgM3" rel="nofollow">http://pastebin.com/raw/Dz6xxgM3</a></p>
  
  <p>My dplyr filter line is</p>
  
  <pre><code>library(dplyr)
  df&lt;-read.table("http://pastebin.com/raw/Dz6xxgM3")
    filter(df,
      proc == "1" | proc == "3" | proc== "4" | proc =="5"  | (proc=="2" &amp; subject != "4") 
    )
  </code></pre>
  
  <p>This works but seems cludgy - I have to put a regex in to include all of the procedures as well as proc ==2.</p>
  
  <p>Is there a more elegant/efficient way to delete the rows for subject 4 in procedure 2 ?</p>
  
  <p>Cheers
  Pete</p>