dates                 package:chron                 R Documentation

_G_e_n_e_r_a_t_e _D_a_t_e_s _a_n_d _T_i_m_e_s _C_o_m_p_o_n_e_n_t_s _f_r_o_m _I_n_p_u_t

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

     dates(x, ...)
     times(x, ...)

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

       x: a chron object, a character vector, or a numeric vector 
          specifying time. If character, it must be in a format
          recognized by `chron()'. If numeric, it specifies Julian
          dates, i.e., number of days since an origin. 

     ...: parameters for `chron()'. 

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

     An object of class `dates' or `times', depending of the function
     called.

     These functions return objects inheriting from dates and times,
     respectively. They call `chron()' if `x' does not belong to any of
     the chronological classes.

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

     `chron', `times', `seq.dates', `cut.dates'

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

     dts <- dates(c("02/27/92", "02/27/92", "01/14/92",
                    "02/28/92", "02/01/92"))
     dts
     # [1] 02/27/92 02/27/92 01/14/92 02/28/92 02/01/92
     class(dts)

     x <- chron(dates = c("02/27/92", "02/27/92", "01/14/92", "02/28/92"),
                times = c("23:03:20", "22:29:56", "01:03:30", "18:21:03"))
     dates(x)
     # [1] 02/27/92 02/27/92 01/14/92 02/28/92

