Skip to content
Prev 205131 / 398506 Next

help with for loop

diff.zoo in the zoo package can take a vector of lags:

library(zoo)
z <- zoo(seq(10)^2)
diff(z, 1:4)

There are three vignettes (pdf documents) that come with zoo that have
more info on the package.


On Fri, Jan 1, 2010 at 8:16 PM, Rafael Moral
<rafa_moral2004 at yahoo.com.br> wrote: