stri_order finds a permutation which rearranges
strings into an ascending or descending order.
stri_sort sorts the vector according to a lexicographic order.
a single logical value; should the sort order
be nondecreasing (FALSE, default)
or nonincreasing (TRUE)?
na_last
a single logical value; controls the treatment of NAs
in str. If TRUE, then missing values in str are put
at the end; if FALSE, they are put at the beginning;
if NA, then they are removed from the output
...
additional settings for opts_collator
opts_collator
a named list with ICU Collator's options,
see stri_opts_collator, NULL
for default collation options
Value
For stri_order, an integer vector that gives the sort order
is returned.
For stri_order, you get a sorted version of str,
i.e., a character vector.
Details
For more information on ICU's Collator and how to tune it up
in stringi, refer to stri_opts_collator.
These functions use a stable sort algorithm (STL's stable_sort),
which performs up to \(N*log^2(N)\) element comparisons,
where \(N\) is the length of str.