title: Trying to remove rows based on values in two columns
body: <p>My data is formatted something like this:</p>
  
  <pre><code> name  value1  rem 
  -------------------
  | tom  | 1   |  1
  | tom  | 3   |  0
  | tom  | 5   |  0
  | bill | 7   |  0
  | bill | 1   |  1
  | bill | 3   |  0
  | mark | 5   |  0
  | mark | 9   |  0
  | mark | 9   |  0
  </code></pre>
  
  <p>What I'm trying to do is remove any row that has a 1 in "rem" and any row that has the same ID as a row with 1 in "rem." So after the transformation I want it would look like:</p>
  
  <pre><code> name  value1  rem 
  -------------------
  | mark | 5   |  0
  | mark | 9   |  0
  | mark | 9   |  0
  </code></pre>
  
  <p>I can't figure out how to do this in R using a logic command. My actual data has far more rows and columns so I can't just delete them by location, i.e. just deleting the first 6 rows. I get how to delete any row with a specific value. What I can't figure out is how to delete rows based on values in two rows one of which is conditional. Here is some R code that made a data frame like above:</p>
  
  <pre><code>name &lt;- c("tom", "tom", "tom", "bill", "bill","bill","mark","mark","mark")
  value1 &lt;- c(1,3,5,7,1,3,5,9,9)
  rem &lt;- c(1,0,0,0,1,0,0,0,0)
  df &lt;- data.frame(name, value1, rem)
  </code></pre>