date.mdy package:survival R Documentation _C_o_n_v_e_r_t _f_r_o_m _J_u_l_i_a_n _D_a_t_e_s _t_o _M_o_n_t_h, _D_a_y, _a_n_d _Y_e_a_r _D_e_s_c_r_i_p_t_i_o_n: Convert a vector of Julian dates to a list of vectors with the corresponding values of month, day and year, and optionally weekday. _U_s_a_g_e: date.mdy(sdate, weekday = FALSE) _A_r_g_u_m_e_n_t_s: sdate: a Julian date value, as returned by 'mdy.date()', number of days since 1/1/1960. weekday: if 'TRUE', then the returned list also will contain the day of the week (Sunday=1, Saturday=7). _V_a_l_u_e: A list with components 'month', 'day', and 'year'. _R_e_f_e_r_e_n_c_e_s: Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P. (1992). _Numerical Recipes: The Art of Scientific Computing (Second Edition)_. Cambridge University Press. _E_x_a_m_p_l_e_s: day <- 7 temp <- date.mdy(mdy.date(month = 7, day = day, year = 1960)) ## Check for illegal dates, such as 29 Feb in a non leap year if (temp$day != day) { cat("Some illegal dates\n") } else { cat("All days are legal\n") }