sort.list: Vector of Indices That Sort Data

sort.listR Documentation

Vector of Indices That Sort Data

Description

The sort.list function from the base package is made generic in the splusTimeDate package with methods for S4 classes: "numericSequence", "positionsCalendar", and "timeSpan".

Usage

sort.list(x, partial = NULL, na.last = TRUE, decreasing = FALSE,
    method)

Arguments

x

a vector or an object of class "numericSequence", "positionsCalendar", and "timeSpan".

partial

vector of indices for partial sorting. (Non-NULL values are not implemented.)

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.

decreasing

a logical value. If TRUE the sort order is decreasing . The default is FALSE.

method

a character value that specifies the method to be used, partial matches are allowed. The default ("auto") implies "radix" for numeric vectors, integer vectors, logical vectors and factors with fewer than 231231 elements. Otherwise, it implies "shell".

Value

an integer vector containing the indices of the sorted data elements. That is, the first integer is the subscript of the smallest data element (if decreasing = FALSE). By default, the returned value has the same length as the input, but it might be shorter if na.last=NA.


splusTimeDate documentation built on Sept. 13, 2024, 1:10 a.m.