home *** CD-ROM | disk | FTP | other *** search
-
- _L_a_g_g_e_d _D_i_f_f_e_r_e_n_c_e_s
-
- diff(x, lag=1, differences=1)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : a numeric vector or matrix containing the
- values to be differenced.
-
- lag : an integer indicating which lag to use.
-
- differences : an integer indicating the order of the
- difference.
-
- _V_a_l_u_e:
-
- If x is a vector of length n and differences=1, then
- the computed result is equal to the successive differ-
- ences x[(1:n-lag)]-x[(lag:n)]. If difference is larger
- than one this algorithm is applied recursively to x.
- Note that the returned value is a vector which is
- shorter than x.
-
- If x is a matrix then the difference operations are
- carried out on each column separately.
-
- NA's propagate.
-
- _E_x_a_m_p_l_e_s:
-
- diff(1:10, 2)
- diff(1:10, 2, 2)
-
-