TITLE(diff @@ Lagged Differences )
USAGE(
diff(x, lag=1, differences=1)
)
ALIAS(diff)
ARGUMENTS(
ARG(x @@ a numeric vector or matrix containing the values to be differenced.)
ARG(lag @@ an integer indicating which lag to use.)
ARG(differences @@ an integer indicating the order of the difference.)
)
VALUE(
If LANG(x) is a vector of length LANG(n) and LANG(differences=1),
then the computed result is equal to the successive differences
LANG(x[(1:n-lag)]-x[(lag:n)]).
If LANG(difference) is larger than one this
algorithm is applied recursively to LANG(x). Note that the returned value
is a vector which is shorter than LANG(x).
PARA
If LANG(x) is a matrix then the difference operations are carried out
on each column separately.
PARA
LANG(NA)'s propagate.
)
EXAMPLES(
diff(1:10, 2)
diff(1:10, 2, 2)
)
