The documentation for diff says:
If `x' is a vector of length `n' and `differences=1', then the
computed result is equal to the successive differences
`x[(1:n-lag)] - x[(lag:n)]'. ...
This last line should say:
`x[(1+lag):n] - x[1:(n-lag)]'.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
documentation for diff (PR#1185)
1 message · Paul Gilbert