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

