Rev 38579 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{package-version} % Cannot have 'package_version' ...\alias{package_version}\alias{is.package_version}\alias{as.package_version}\alias{as.character.package_version}\alias{print.package_version}\alias{Ops.package_version}\alias{Summary.package_version}\alias{c.package_version}\alias{[.package_version}\alias{[[.package_version}\alias{$.package_version}\alias{as.data.frame.package_version}\alias{.encode_package_version}\alias{.decode_package_version}\alias{getRversion}\title{Package versions}\description{A simple S3 class for representing package versions, andassociated methods.}\usage{package_version(x, strict = TRUE)getRversion()}\arguments{\item{x}{a character vector with package version strings, or an Rversion object as obtained by \code{\link{R.version}}.}\item{strict}{a logical indicating whether invalid package versionsshould results in an error (default) or not.}}\details{\R (package) versions are sequences of at least two non-negativeintegers, usually (e.g., in package \file{DESCRIPTION} files)represented as character strings with the elements of the sequenceconcatenated and separated by single \samp{.} or \samp{-} characters.\code{package_version} creates a representation from such stringswhich allows for coercion and testing, combination, comparison,summaries (min/max), inclusion in data frames, subscripting, andprinting.\code{getRversion} returns the version of the running \R as an objectof class \code{"package_version"}.}\seealso{\code{\link{compareVersion}}}\examples{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$majorx$minor}\keyword{utilities}