package-version {base} | R Documentation |
A simple S3 class for representing package versions, and associated methods.
package_version(x, strict = TRUE) getRversion()
x |
a character vector with package version strings. |
strict |
a logical indicating whether invalid package versions should results in an error (default) or not. |
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"
.
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