Orders a vector of version numbers, in natural order.

orderVersion(x, ..., decreasing = FALSE)

sortVersion(x, ...)

Arguments

x

a character vector of version numbers

...

extra parameters passed to orderVersion and order

decreasing

a logical that indicates if the ordering should be decreasing

Examples

v <- c('1.0', '1.03', '1.2') order(v)
#> [1] 1 2 3
orderVersion(v)
#> [1] 1 3 2
sort(v)
#> [1] "1.0" "1.03" "1.2"
sortVersion(v)
#> [1] "1.0" "1.2" "1.03"