sort-methods: sorting or ordering more complex objects

Description Usage Arguments Value Author(s)

Description

sorting or ordering more complex objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sort(x, decreasing = FALSE, na.last = NA, FUN, ...)

## S4 method for signature 'matrix'
sort(x, decreasing = FALSE, na.last = NA, FUN, ...)

## S4 method for signature 'data.frame'
sort(x, decreasing = FALSE, na.last = NA, FUN, ...)

## S4 method for signature 'ANY'
sort(x, decreasing = FALSE, na.last = NA, FUN, ...)

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.

decreasing

logical. Should the sort be increasing or decreasing? For the "radix" method, this can be a vector of length equal to the number of arguments in .... For the other methods, it must be length one. Not available for partial sorting.

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.

FUN

a sort function. if x is 2D or more, then this is applied to the 1st dimension (ie the rows)

...

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

Value

a sorted object of same type as x

Author(s)

Mark Cowley


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.