title: Using ifelse on factor in R
body: <p>I am restructuring a dataset of species names. It has a column with latin names and column with trivial names when those are available. I would like to make a 3rd column which gives the trivial name when available, otherwise the latin name. Both trivial names and latin names are in factor-class.
  I have tried with an if-loop:  </p>
  
  <pre><code>  if(art2$trivname==""){  
      art2$artname=trivname   
      }else{  
        art2$artname=latname  
      }  
  </code></pre>
  
  <p>It gives me the correct trivnames, but only gives NA when supplying latin names.<br>
  And when I use ifelse I only get numbers.</p>
  
  <p>As always, all help appreciated :)</p>