sort.index: Index extraction

Description Usage Arguments Details Value Note Author(s) See Also

View source: R/index.R

Description

Functions to extract from an index 1) the original vecor, 2) the sorted vector, 3) the original positions (order) and 4) logical NAiness.

Usage

1
2
3
4
5
6
7
  ## 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)

Arguments

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)

Details

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 NextMethod)
[<-.index currently forbidden
is.na.index identical to is.na of original vector, but much faster

Value

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.

Note

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).

Author(s)

Jens Oehlschl<e4>gel

See Also

index, sort, order, [


rindex documentation built on Sept. 1, 2018, 1:04 a.m.

Related to sort.index in rindex...