title: Comparing the content of two character columns with dplyr
body: <p>I am trying to compare if the content of one column is equal or different from the content of another. </p>
  
  <pre><code>Response &lt;- c("Old", "New", "Old", "New")
  Correct_answer &lt;- c("New", "Old", "Old", "New")
  comparison &lt;- data.frame(Response, Correct_answer)
  </code></pre>
  
  <p>I tried this:   </p>
  
  <pre><code>mutate(comparison, Resp_final = ifelse(grepl("Old", Response), "1",
                                    ifelse(grepl("New", Response), "2", "")))
  </code></pre>
  
  <p>But it only checks for the "Response" column. How can I compare both "Response" and "Correct_answer" columns and get the result in one column using dplyr?</p>
  
  <p>Thanks!</p>