lag                package:timeSeries                R Documentation

_L_a_g _a _T_i_m_e _S_e_r_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute a lagged version of a 'timeSeries' object.

_U_s_a_g_e:

     ## S4 method for signature 'timeSeries':
     lag(x, k = 1, trim = FALSE, units = NULL, ...)

_A_r_g_u_m_e_n_t_s:

       k: [lagSeries] - 
              an integer value. The number of lags (in units of
          observations). By default 1. 

    trim: a logical value. By default 'TRUE', the first missing 
          observation in the return series will be removed.  

   units: an optional character string, which allows to overwrite the 
          current column names of a 'timeSeries' object. By default 
          'NULL' which means that the column names are selected
          automatically. 

       x: an object of class 'timeSeries'. 

     ...: arguments passed to other methods. 

_V_a_l_u_e:

     returns a lagged S4 object of class 'timeSeries'.

_E_x_a_m_p_l_e_s:

     ## data -
        x = as.timeSeries(data(msft.dat))[1:20, "Open"]
        
     ## lag -
        # Lag the timeSeries Object:
        lag(x, k = -1:1)

