str_order {stringr} | R Documentation |
Order or sort a character vector.
str_order(
x,
decreasing = FALSE,
na_last = TRUE,
locale = "en",
numeric = FALSE,
...
)
str_sort(
x,
decreasing = FALSE,
na_last = TRUE,
locale = "en",
numeric = FALSE,
...
)
x |
A character vector to sort. |
decreasing |
A boolean. If |
na_last |
Where should |
locale |
In which locale should the sorting occur? Defaults to the English. This ensures that code behaves the same way across platforms. |
numeric |
If |
... |
Other options used to control sorting order. Passed on to
|
stringi::stri_order()
for the underlying implementation.
str_order(letters)
str_sort(letters)
str_order(letters, locale = "haw")
str_sort(letters, locale = "haw")
x <- c("100a10", "100a5", "2b", "2a")
str_sort(x)
str_sort(x, numeric = TRUE)