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")

