title: Looking up a particular column in R depending on another column
body: <p>In an experiment, people had four candidates to choose from; sometimes they're male, other times they're female. In the below dataframe, C1 means Candidate 1, C2 means Candidate 2, and so on. F denotes female while M denotes male. A response of 1 indicates the person chose C1, a response of 2 indicates the person chose C2, and so on.</p>
  
  <pre><code>C1    C2    C3    C4    response
  F     F     M     M     2
  M     M     F     M     1
  </code></pre>
  
  <p>I want a new column "ChooseFemale" which equals to 1 if the candidate chose a female candidate, and zero otherwise. So the first row should have ChooseFemale equal to 1, while the second row should have ChooseFemale equal to zero. </p>
  
  <p>This would require me to look up a certain column depending on the value of "response" column. </p>
  
  <p>How can I do this?</p>