title: R programming - if/else command
body: <p>i am a new student of R programming since my current job has required that i become adapt to it.  I just started however, and as with anything the learning curve is steep.  My current project requires me to use the if/else or for command.  There are a set of numbers:</p>
  
  <pre><code>1.586077^+00
  3.242631^-03
  2.426304^-03
  8.616781^-04
  5.396826^-03
  2.947846^-04
  1.018943^+01
  8.639457^-03
  8.458051^-03
  2.807870^+02
  </code></pre>
  
  <p>now I need a command which goes through these numbers and if the number is greater than 1, then it writes it down.  If the number is less than 1, then it adds it till it hits the next number greater than 1 and then writes the sum from the beginning to that point.  So for example:</p>
  
  <p>Since the above set has 10 numbers, the output should like: <code>1, 2.138069469, 10.025406833</code></p>
  
  <p>Thanks for the help!</p>