home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / diff < prev    next >
Encoding:
Text File  |  1997-04-23  |  917 b   |  35 lines

  1.     
  2.     _L_a_g_g_e_d _D_i_f_f_e_r_e_n_c_e_s
  3.     
  4.          diff(x, lag=1, differences=1)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.                x : a numeric vector or matrix containing the
  9.                    values to be differenced.
  10.     
  11.              lag : an integer indicating which lag to use.
  12.     
  13.      differences : an integer indicating the order of the
  14.                    difference.
  15.     
  16.     _V_a_l_u_e:
  17.     
  18.          If x is a vector of length n and differences=1, then
  19.          the computed result is equal to the successive differ-
  20.          ences x[(1:n-lag)]-x[(lag:n)].  If difference is larger
  21.          than one this algorithm is applied recursively to x.
  22.          Note that the returned value is a vector which is
  23.          shorter than x.
  24.     
  25.          If x is a matrix then the difference operations are
  26.          carried out on each column separately.
  27.     
  28.          NA's propagate.
  29.     
  30.     _E_x_a_m_p_l_e_s:
  31.     
  32.          diff(1:10, 2)
  33.          diff(1:10, 2, 2)
  34.     
  35.