days1                 package:ssBase                 R Documentation

_D_a_y, _M_o_n_t_h _a_n_d _Y_e_a_r _o_f _D_a_t_e_t_i_m_e_s _V_a_l_u_e

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

     These functions act in a similar way as the 'chron' functions
     'days', 'months' and 'years'. See "Details" below.

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

     days1(x)
     months1(x)
     years1(x)

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

       x: a datetimes object. 

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

     The datetimes object is a numeric vector containing the number of
     days and fractions thereof from some defined origin, often 1 Jan
     1970.

     In versions of 'chron' prior to 2.2-35, there was a bug. This
     caused the functions 'days', 'months', and 'years' to sometimes be
     erroneous for dates before the origin. For example,
     'chron(dates.="12/31/1969", times.="18:00:00")' would give
     '"01/01/1970  -6:00:00"'. This appears to have been fixed in
     version 2.2-35. It was probably caused by a call to 'trunc' in
     'month.day.year' rather than 'floor'.

     Another difference is that the values returned by the 'chron'
     functions 'days', 'months', and 'years' are ordered factors. This
     is not the case for 'days1', 'months1' and 'years1'.

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

     A numeric vector of the same length as 'x' giving either the day
     of the month (1, ..., 31), the month (1, ..., 12), or the year
     (e.g. 1998).

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

     'datetimes', 'days', 'months', 'years', 'hrs.mins.secs'

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

     x <- julian(12,31,1969) + 18/24
     print(x)
     #   x represents 18:00:00 hrs on 31 Dec 1969
     #   x = -1 + 18/24 = -0.25

     x <- datetimes(1998, 6, 2, 13, 34, 25.9, dp.second=1)
     print(days1(x))
     print(months1(x))
     print(years1(x))
     print(hrs.mins.secs(x))

