title: How can I create a new variable using 2 columns that satisfy certain conditions using RStudio
body: <p>I would like to create a column of infection status for individuals. In my dataset, Malaria_RDT is a Malaria diagnostic test and CCA_test is a Schistosomiasis diagnostic test.</p>
  
  <p>I want my new variable of infection status to be either; ONLY malaria infection, ONLY Schistosomiasis infection, neither malaria OR schistosomiasis infection or both malaria AND schistosomiasis infection </p>
  
  <p>My dataset is called co.inf</p>
  
  <pre><code>if Malaria_RDT==0 and CCA_test==0, then inf.st = 0;
  if Malaria_RDT &gt;0 and CCA_test==0, then inf.st = 1;
  if Malaria_RDT==0 and CCA_test &gt;0, then inf.st = 2; and
  if Malaria_RDT &gt;=1 and CCA_test &gt;=1, then inf.st = 3
  </code></pre>