title: Shortcut for if else
body: <p>What is the shortest way to express the folowing decission rule</p>
  
  <pre><code>df&lt;-data.frame(a=LETTERS[1:5],b=1:5)
  index&lt;-df[,"a"]=="F"
  if(any(index)){
    df$new&lt;-"A"
  }else{
    df$new&lt;-"B"
  }
  </code></pre>