title: Different results with "same" code
body: <p>I am asking a simple question. Why are these two code fragments not the same?</p>
  
  <pre><code>pNl &lt;- {}
  
  for(i in length(x):length(x)-250) { 
      temp &lt;-x[i] - x[i-1] 
      pNl &lt;-append(pNl, temp, length(pNl))
  }
  
  pNl
  </code></pre>
  
  <p>and</p>
  
  <pre><code>PnL &lt;- {}
  
  for(i in length(x):(length(x)-250)) {
      temp &lt;- x[i] - x[i-1]
      PnL &lt;- append(PnL, temp, length(PnL))
  }
  
  
  PnL
  </code></pre>
  
  <p>I get different results when I execute them...</p>
  
  <p>I really appreciate your answer!!!</p>