title: What are the factors that influence system.time function in R?
body: <p>I used two formulas for calculating the variance which were almost the same but the derivation differs.</p>
  
  <p>1) <code>xVarCom &lt;- (xSquareSum - (n*xMeanSquare)) / (n-1)</code> [Note: Mean square = sum square/n and squaresum is 1square+2square.....nsquare]</p>
  
  <p>2)  <code>varLoop &lt;- (varLoop + (x[i]-(xMean)^2)/(n-1)</code></p>
  
  <p>I have given the limits as 1:n.
  Both gives the same variance, but when I give higher values of mean like more than 100 thousands the first one is getting break down. Also the first expression elapsed time is faster than the second one. why is this happening?</p>