version_compare: Compare two version strings

View source: R/configuration.R

version_compareR Documentation

Compare two version strings

Description

version_compare takes two strings for software versions(e.g. "1.0.2") and returns >, <, or = depending on whether the first version is later, earlier, or equivalent to the second version. For example, "1.2.0" > "1.1.5".

Usage

version_compare(ver1txt, ver2txt)

Arguments

ver1txt

single character string for a software version

ver2txt

single character string for a software version

Details

If there are fewer fields in one string than the other, the one with fewer is padded with zeros for the least-significant positions. For example 1.2.3 vs 1.2 is equivalent to 1.2.3 vs 1.2.0.

Value

a single character representing if if the first version is later (>), earlier (<), or equivalent (=) to the second version


ressy/microsat documentation built on Aug. 24, 2023, 10:09 a.m.