title: Combining two columns conditionally in R
body: <p>I am trying to create a new column based on the values of two other columns. The values in the initial columns are 1 and 2. For the new column, I want the value to be 1 if the value in either of the first two columns is 1 and to be 0 otherwise. (If the person is either <code>Vegetarian</code> or <code>Vegan</code>, the <code>VegYesNo</code> column should be 1. Otherwise, it should be 0). </p>
  
  <pre><code>Vegetarian Vegan VegYesNo
  1          2     1
  2          2     0
  2          1     1
  </code></pre>
  
  <p>I've searched the other questions on here and didn't find one that gave me an answer, but please let me know if you know of a question that has a solution that would work.</p>