title: refactor data.frame column values
body: <p>Sorry guys if this is a noob question.
  I need help on how to loop over my dataframe.Here is a sample data.</p>
  
  <pre><code>a &lt;- c(10:29);
  b &lt;- c(40:59);
  e &lt;- rep(1,20);
  test &lt;- data.frame(a,b,e)
  </code></pre>
  
  <p>I need to manipulate column "e" using the following criteria for values in column "a"</p>
  
  <p>for all values of</p>
  
  <p>"a" &lt;= 15, "e" = 1,</p>
  
  <p>"a" > 15 &amp; &lt; 20, "e" = 2</p>
  
  <p>"a" > 20 &amp; &lt; 25, "e" = 3</p>
  
  <p>"a" > 25 &amp; &lt; 30, "e" = 4 and so on to look like this</p>
  
  <pre><code>result &lt;- cbind(a,b,rep(1:4, each=5))
  </code></pre>
  
  <p>My actual data frame is over 100k long. Would be great if you could sort me out here.</p>