Re: [R] Different result on using apply.

2011-07-30 Thread Ashim Kapoor
Thank you Dennis and Peter. On Fri, Jul 29, 2011 at 1:59 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: To add to Peter Dalgaard's comments, a look at head(ret) and head(returns) would also have clued you in: head(ret, 1) GOOG.OpenGOOG.High GOOG.Low GOOG.Close

[R] Different result on using apply.

2011-07-29 Thread Ashim Kapoor
Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell me why I see a lagged result,by which I mean ret and returns are different by one lag.

Re: [R] Different result on using apply.

2011-07-29 Thread peter dalgaard
(oops, forgot to cc. the list) On Jul 29, 2011, at 08:09 , Ashim Kapoor wrote: Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell me why I

Re: [R] Different result on using apply.

2011-07-29 Thread Dennis Murphy
Hi: To add to Peter Dalgaard's comments, a look at head(ret) and head(returns) would also have clued you in: head(ret, 1) GOOG.OpenGOOG.High GOOG.Low GOOG.Close GOOG.Volume 2007-01-03 1.377067e-05 3.184271e-05 3.378641e-05 7.049545e-05 3.01405e-09