compareVersion

0th

Percentile

Compare Two Package Version Numbers

Compare two package version numbers to see which is later.

Keywords
utilities
Usage
compareVersion(a, b)
Arguments
a, b

Character strings representing package version numbers.

Details

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

Value

0 if the numbers are equal, -1 if b is later and 1 if a is later (analogous to the C function strcmp).

See Also

package_version, library, packageStatus.

Aliases
  • compareVersion
Examples
library(utils) # NOT RUN { compareVersion("1.0", "1.0-1") compareVersion("7.2-0","7.1-12") # }
Documentation reproduced from package utils, version 3.6.1, License: Part of R 3.6.1

Community examples

Looks like there are no examples yet.