title: Error: condition has length > 1 and only the first element will be used in r
body: <p>I have looked but I just don't understand why im getting this error. I want to allocate a number in CNSTATUS depending on the integer value in the column CN
  If less than 10, the CNSTATUS should be 10, if between 10 and 20 CNSTATUS shuold be 2 and if more than 20 it should be 3</p>
  
  <p>CN is an integer column</p>
  
  <p>My dataframe</p>
  
  <pre><code>CN       CNSTATUS
   2          
   12
   43
    2
    4
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code> if(OCCAMSdbTumCN$CN &lt; 10) {
    OCCAMSdbTumCN$CNSTATUS &lt;- 1
   }
   else if(OCCAMSdbTumCN$CN &gt; 10 &amp; OCCAMSdbTumCN$CN&lt;20) {
     OCCAMSdbTumCN$CNSTATUS &lt;- 2
   }
   else{
   OCCAMSdbTumCN$CNSTATUS &lt;- 2}
  
  
   The error I am getting is
  
  In if (OCCAMSdbTumCN$CN &lt; 10) { :
    the condition has length &gt; 1 and only the first element will be used
  </code></pre>