title: Adding binary values to a column based on pre-defined column values
body: <p>I have a sample dataset which is as follows:</p>
  <pre><code> df &lt;- structure(list(Category1 = c(&quot;Alpha: 0&quot;, &quot;Alpha: 0&quot;, &quot;Alpha: 0&quot;, 
                                      &quot;Alpha: 3&quot;, &quot;Alpha: 0&quot;), 
                        Category2 = c(&quot;Beta: 1&quot;, &quot;Beta: 0&quot;,  &quot;Beta:0&quot;, 
                                      &quot;Beta: 1&quot;, &quot;Beta: 1&quot;), 
                        Category3 = c(&quot;Charlie: 2&quot;,  &quot;Charlie: 0&quot;,
                                      &quot;Charlie: 0&quot;, &quot;Charlie: 2&quot;, &quot;Charlie: 2&quot;), 
                        Output = c(NA,  NA, NA, NA, NA)), class = &quot;data.frame&quot;, row.names = c(NA, -5L ))
  </code></pre>
  <p>I am trying to add binary values of 1 or 0 in the Output column based on the values in <code>Category1</code>, <code>Category2</code>, <code>Category3</code> columns. If the value in each of these columns is as follows: &quot;Alpha: 0&quot;, &quot;Beta: 0&quot; and &quot;Charlie: 0&quot; then I would like to have &quot;1&quot; added in the same row under the Output column. For any other combinations, I would like to have &quot;0&quot; added in the Output column. Any suggestions on how this can be accomplished in a simplistic manner?</p>
  <p>Thanks!</p>