title: R: Best way to create a new dummy variable based on numerous cutoff conditions?
body: <p>What is the easiest way to create a dummy variable given a number of conditions.</p>
  
  <p>For example, let's say I have the following dataframe (data):</p>
  
  <pre><code>birth    ID
  1958     176
  1958     178
  1959     300
  1959     301
  1960     500
  1960     600
  1961     216
  1961     201
  1962     100
  </code></pre>
  
  <p>I want to create a new variable, eligible, that is 1 IF any one of the following conditions is satisfied:</p>
  
  <p>Birth year is 1958 and ID is greater than 175; Birth year is 1959 and ID is greater than 320, Birth year is 1960 and ID is greater than 341... and so on.</p>
  
  <p>I know I can do this with numerous ifelse commands, but I was hoping there was a more parsimonious way of doing this.</p>
  
  <p>Data</p>
  
  <pre><code>data &lt;- structure(list(birth = c(1958L, 1958L, 1959L, 1959L, 1960L, 1960L, 1961L, 1961L, 1962L),
                         ID = c(176L, 178L, 300L, 301L, 500L, 600L, 216L, 201L, 100L)),
                    .Names = c("birth", "ID"), class = "data.frame", row.names = c(NA, -9L))
  </code></pre>