title: How can I assign a value using if-else conditions in R
body: <p>I have this dataframe with a column a. I would like to add a different column 'b' based on column 'a'.</p>
  
  <pre><code>For: if a&gt;=10, b='double'. Otherwise b='single'.
  </code></pre>
  
  <p>How can I do it?</p>
  
  <p>Sample output:</p>
  
  <pre><code>a b
  2 single
  2 single
  4 single
  11 double
  12 double
  12 double
  45 double
  4 single
  </code></pre>