Description Usage Arguments Examples
sort bstr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
x |
x |
decreasing |
A boolean. If FALSE, the default, sorts from lowest to highest; if TRUE sorts from highest to lowest. |
... |
... |
by |
sort bstr object by c("names", "length") |
bstrobj |
bstr class object or character vector |
na_last |
Where should NA go? TRUE at the end, FALSE at the beginning, NA dropped. |
numeric |
If TRUE, will sort digits numerically, instead of as strings. |
pattern |
regular expression to extract substrings of the name to sort |
start |
start position to extract substrings of the name |
end |
end position to extract substrings of the name |
1 2 3 4 5 6 7 8 9 10 11 | test <- bstr_rand_seq(6, c(10, 5, 10, 12, 13, 3), seed = 1)
test
sort(test, decreasing = TRUE)
sort(test, by = "length")
names(test) <- c("test1", "test10", "test10", "test20", "test3", "test100")
sort(test)
bstr_sort(test)
bstr_sort_subname(test, "test.")
bstr_sort_subname(test, start = 1, end = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.