This function extends the sorting capabilities for alphanumeric strings by
allowing for sorting of mixed numeric and character strings, with additional
control over sorting direction, treatment of NA
and blank values, and
handling of numeric values represented as either decimal numbers or Roman
numerals. This function is a wrapper function for the gtools::mixedsort
function.
Arguments
- x
Vector to be sorted.
- decreasing
logical. Should the sort be increasing or decreasing? Note that
descending=TRUE
reverses the meanings ofna.last
andblanks.last
.- na.last
for controlling the treatment of
NA
values. IfTRUE
, missing values in the data are put last; ifFALSE
, they are put first; ifNA
, they are removed.- blank.last
for controlling the treatment of blank values. If
TRUE
, blank values in the data are put last; ifFALSE
, they are put first; ifNA
, they are removed.- numeric.type
either "decimal" (default) or "roman". Are numeric values represented as decimal numbers (
numeric.type="decimal"
) or as Roman numerals (numeric.type="roman"
)?- roman.case
one of "upper", "lower", or "both". Are roman numerals represented using only capital letters ('IX') or lower-case letters ('ix') or both?