compareVersion             package:utils             R Documentation

_C_o_m_p_a_r_e _T_w_o _P_a_c_k_a_g_e _V_e_r_s_i_o_n _N_u_m_b_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compare two package version numbers to see which is later.

_U_s_a_g_e:

     compareVersion(a, b)

_A_r_g_u_m_e_n_t_s:

    a, b: Character strings representing package version numbers.

_D_e_t_a_i_l_s:

     R package version numbers are of the form 'x.y-z' for integers
     'x', 'y' and 'z', with components after 'x' optionally missing (in
     which case the version number is older than those with the
     components present).

_V_a_l_u_e:

     '0' if the numbers are equal, '-1' if 'b' is later and '1' if 'a'
     is later (analogous to the C function 'strcmp').

_S_e_e _A_l_s_o:

     'package_version', 'library', 'packageStatus'.

_E_x_a_m_p_l_e_s:

     compareVersion("1.0", "1.0-1")
     compareVersion("7.2-0","7.1-12")

