title: R - Create New Column
body: <p>I have the following data frame:</p>
  
  <pre><code>X1
  House-US
  House-FR
  FR-FR
  US-US
  FR-US
  </code></pre>
  
  <p>I would like to create a second column such that:</p>
  
  <pre><code>X1       X2
  House-US House 
  House-FR House
  FR-FR    Ia
  US-US    Ia
  FR-US    Ir
  </code></pre>
  
  <p>If a row starts with House then X2 equal to House, If a row has left equal to right (FR-FR) then X2 equal to Ia and Else X2 equal to Ir.</p>
  
  <p>Do you have a solution?</p>