Mdates                 package:uroot                 R Documentation

_D_e_t_e_r_m_i_n_e _t_h_e _L_o_c_a_t_i_o_n _i_n _t_h_e _S_a_m_p_l_e _o_f _a _D_a_t_e _a_n_d _v_i_c_e _v_e_r_s_a

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

     This function determines the year and season to which a given
     observation in the sample is related to, and the location in the
     sample of a given time specified by the year and the season.

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

         Mdates (wts, yso)
       

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

     wts: a univariate time series object.

     yso: either a vector of length two indicating the year and season
          or a vector on length one indicating the location in the
          sample of an observation.

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

     An object of class 'vdate-class'.

_A_u_t_h_o_r(_s):

     Javier Lpez-de-Lacalle javlacalle@yahoo.es and Ignacio
     Daz-Emparanza Ignacio.Diaz-Emparanza@ehu.es

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

     'stepdate-methods'.

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

         ## Mdates
         data(AirPassengers)
         ## Which date is related to the 12th observation?
         out1 <- Mdates(AirPassengers, 12)
         out1
         out1@Myso
         ## Where is located the observation in 1959.2
         out2 <- Mdates(AirPassengers, c(1959,2))
         out2
         ## Beyond the sample.
         Mdates(AirPassengers, 150)
         Mdates(AirPassengers, c(1970,2))

         ## Which is the next date after the 12th observation?
         stepdate(as.vdate(AirPassengers, yso=12), step=1)
       

