Learn R Programming

alR (version 2.2.0)

pairSort: Sorted vector index.

Description

The sorted vector is returned along with the original index of the vector it belonged to.

Usage

pairSort(x)

Arguments

x

A real-valued vector to be sorted.

Value

A list with two components:

  • sorted: The sorted version of x.

  • index: The index of the \(i^{th}\) element in x.

Examples

Run this code
# NOT RUN {
pairSort(c(5, 2, 6))
# }

Run the code above in your browser using DataLab