package-version             package:base             R Documentation

_P_a_c_k_a_g_e _v_e_r_s_i_o_n_s

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

     A simple S3 class for representing package versions, and
     associated methods.

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

     package_version(x, strict = TRUE)

     getRversion()

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

       x: a character vector with package version strings.

  strict: a logical indicating whether invalid package versions should
          results in an error (default) or not.

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

     R (package) versions are sequences of at least two non-negative
     integers, usually (e.g., in package 'DESCRIPTION' files)
     represented as character strings with the elements of the sequence
     concatenated and separated by single '.' or '-' characters.

     'package_version' creates a representation from such strings which
     allows for coercion and testing, combination, comparison,
     summaries (min/max), inclusion in data frames, subscripting, and
     printing.

     'getRversion' returns the version of the running R as an object of
     class '"package_version"'.

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

     'compareVersion'

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

     x <- package_version(c("1.2-4", "1.2-3", "2.1"))
     x < "1.4-2.3"
     c(min(x), max(x))
     x[2, 2]
     x$major
     x$minor

