| sort.index {rindex} | R Documentation |
Functions to extract from an index 1) the original vecor, 2) the sorted vector, 3) the original positions (order) and 4) logical NAiness.
## S3 method for class 'index': x[i, ...] ## S3 method for class 'index': sort(x, decreasing = FALSE, na.last = NA, ...) order.index(..., na.last = TRUE, decreasing = FALSE) ## S3 method for class 'index': is.na(x)
x |
an object of class ‘index’ |
i |
subset information |
... |
one object of class ‘index’ for order.index, otherwise not to be used |
decreasing |
TRUE to sort decreasing (default FALSE) |
na.last |
FALSE to sort NAs first (default TRUE) |
sort.index | identical to sort of original vector, but much faster |
order.index | identical to order of original vector, but much faster |
[.index | index[] returns original vector, subsetting works identical to susetting original vector [ (via Next.Method) |
[<-.index | currently forbidden |
is.na.index | identical to is.na of original vector, but much faster |
Function [.index returns the original vector (or part of it), sort.index returns a sorted vector of values, order.index returns a vector of original integer positions and is.na.index returns a logical vector.
There are dummy functions names.index, names<-.index and [<-.index that catch non-supported use of these generics on index objects.
Note that for non-unique indices order.index(...,decreasing=TRUE) handles ties not identical to order(...,decreasing=TRUE).
Jens Oehlschlägel