title: If/else function on a data frame to create conditional matrix
body: <p>Here is the data set for reproducibility:</p>
  
  <pre><code>    a=c(90.41,37.37,18.98)
      b=c(103.39,39.44,51.68)
      c=c(83.51,36.41,47.46)
      d=c(94.60,38.57,50.22)
      e=c(95.04,38.81,50.49)
      xx=t(data.frame(a,b,c,d,e))
      df=data.frame(xx)
  </code></pre>
  
  <p>And here is the if/else function I am trying run on the data frame</p>
  
  <pre><code> classify=function(df){
   if (df&gt;=110) {
   class="5"}
   else if (df&lt;110 &amp; df&gt;=103){
   class="4"}
   else if (df&lt;103 &amp; df&gt;=95){
   class="3"}
   else if (df&lt;95 &amp; df&gt;=76){
   class="2"}
   else if (df&lt;76){
   class="1"}
   else {class="none"}
   }  
  </code></pre>
  
  <p>However, what I want the if/else function to produce is a new data frame that looks like this:</p>
  
  <pre><code>     df
       X1 X2 X3
      a  2  1  1
      b  4  1  1
      c  2  1  1
      d  2  1  1
      e  3  1  1
  </code></pre>
  
  <p>I am unsure as to how to do this so any help would be super appreciated. I anticipate something is wrong in the if/else function itself but I am quite inexperienced and I don't know how to detect errors in the script that easily. Thank you!</p>