Sort With A Key

sorted(x, key = identity, decreasing = FALSE, ...)

# S3 method for default
sorted(x, key = identity, decreasing = FALSE, na.last = NA, ...)

Arguments

x

for sort an R object with a class or a numeric, complex, character or logical vector. For sort.int, a numeric, complex, character or logical vector, or a factor.

key

A function that takes a single argument, defaults to identity

decreasing

logical. Should the sort be increasing or decreasing? Not available for partial sorting.

...

arguments to be passed to or from methods or (for the default methods and objects without a class) to sort.int.

na.last

for controlling the treatment of NAs. If TRUE, missing values in the data are put last; if FALSE, they are put first; if NA, they are removed.