time                  package:stats                  R Documentation

_S_a_m_p_l_i_n_g _T_i_m_e_s _o_f _T_i_m_e _S_e_r_i_e_s

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

     'time' creates the vector of times at which a time series was
     sampled.

     'cycle' gives the positions in the cycle of each observation.

     'frequency' returns the number of samples per unit time and
     'deltat' the time interval between observations (see 'ts').

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

     time(x, ...)
     ## Default S3 method:
     time(x, offset=0, ...)

     cycle(x, ...)
     frequency(x, ...)
     deltat(x, ...)

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

       x: a univariate or multivariate time-series, or a vector or
          matrix.

  offset: can be used to indicate when sampling took place in the time
          unit. '0' (the default) indicates the start of the unit,
          '0.5' the middle and '1' the end of the interval.

     ...: extra arguments for future methods.

_D_e_t_a_i_l_s:

     These are all generic functions, which will use the 'tsp'
     attribute of 'x' if it exists. 'time' and 'cycle' have methods for
     class 'ts' that coerce the result to that class.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'ts', 'start', 'tsp', 'window'.

     'date' for clock time, 'system.time' for CPU usage.

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

     require(graphics)

     cycle(presidents)
     # a simple series plot
     plot(as.vector(time(presidents)), as.vector(presidents), type="l")

