Title: | Sort and Order Version Codes |
---|---|
Description: | A lightweight package for sorting version codes in various forms. No strong dependencies guaranteed. |
Authors: | Laura Bakala [cre, aut, cph] |
Maintainer: | Laura Bakala <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.1.0 |
Built: | 2024-11-20 05:35:24 UTC |
Source: | https://github.com/turtletopia/versionsort |
ver_latest()
returns the latest of the version codes.
ver_latest(x)
ver_latest(x)
x |
|
A character vector with one element.
ver_latest(c("1.3-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))
ver_latest(c("1.3-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))
ver_oldest()
returns the oldest of the version codes.
ver_oldest(x)
ver_oldest(x)
x |
|
A character vector with one element.
ver_oldest(c("1.3-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))
ver_oldest(c("1.3-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))
ver_order()
returns the permutation that rearranges a vector
of version codes alphanumerically.
ver_order(x)
ver_order(x)
x |
|
An integer vector (for details see order
).
ver_sort()
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)]
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)]
ver_sort()
returns a sorted vector of version codes, where
sorting is done alphanumerically.
ver_sort(x)
ver_sort(x)
x |
|
A character vector containing the same elements as input, but reordered.
ver_sort(c("1.5-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))
ver_sort(c("1.5-0", "1.4-1", "0.0.0.9000", "1.4-0a", "1.4-0"))