ver_order: Order version codes

View source: R/versionsort.R

ver_orderR Documentation

Order version codes

Description

ver_order() returns the permutation that rearranges a vector of version codes alphanumerically.

Usage

ver_order(x)

Arguments

x

character()
A vector of version codes that start with a number (as in "1.5.0"), i.e. without initial "v" (as in "v1.5.0").

Value

An integer vector (for details see order).

See Also

ver_sort()

Examples

version_codes <- c("1.5-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0")
ver_order(version_codes)
# The line below is the same as ver_sort(version_codes)
version_codes[ver_order(version_codes)]


versionsort documentation built on March 25, 2022, 9:07 a.m.