tfwindow               package:tframe               R Documentation

_T_r_u_n_c_a_t_e _a _T_i_m_e _S_e_r_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Truncate a time series object to a time window.

_U_s_a_g_e:

         tfwindow(x, tf=NULL, start=tfstart(tf), end=tfend(tf), warn=TRUE)
         ## Default S3 method:
         tfwindow(x, tf=NULL, start=tfstart(tf), end=tfend(tf), warn=TRUE)
         ## S3 method for class 'ts':
         tfwindow(x, tf=NULL, start=tfstart(tf), end=tfend(tf), warn=TRUE)
         ## S3 method for class 'tframe':
         tfwindow(x, tf=NULL, start=tfstart(tf), end=tfend(tf), warn=TRUE)
         

_A_r_g_u_m_e_n_t_s:

       x: A time series object.

   start: A start date of a format compatible with the time series

     end: An end date of a format compatible with the time series

      tf: A tframe or tframed object

    warn: A logical indicating if warning should be produced

_D_e_t_a_i_l_s:

     If 'start' or 'end' are omitted and 'tf' is specified then the
     start or end is taken from the 'tf' object. For ts class objects
     this function calls window but makes more effort to  preserve
     'seriesNames' if 'x' has them.  It also supports the optional
     argument 'warn' to suppress warning messages. Frequently it is
     convenient to write code which always  truncates to a window
     without first checking if the data is already within  the window.
     Since window produces a warning in this situation, the optional 
     argument is frequently useful when tfwindow is used by other code.
     In Splus 'tfwindow' also corrects for some bugs in older versions 
     of code{window}.

     The method for windowing a tframe is a utility to be used by other
     programs and would not typically be called by a user.

_V_a_l_u_e:

     A time series object similar to x, but typically spanning a
     shorter time period.

_E_x_a_m_p_l_e_s:

       z <- ts(matrix(rnorm(24),24,1), start=c(1980,1), frequency=4)
       zz <- tfwindow(z, start=c(1982,2))
       zzz <- matrix(rnorm(24),24,1)
       tframe(zzz) <- tframe(z)
       tfwindow(zzz, tf=tframe(zz))

