Learn R Programming

ThreeWay (version 1.1.4)

ord: Order

Description

In case of vectors, an ordering of its elements in ascending order is produced; in case of matrices, the ordering in ascending order refers to every column.

Usage

ord(X)

Value

A

Vector or matrix with the elements sorted in ascending order

a

Vector or matrix with the ordering indices

Arguments

X

Vector or matrix to be ordered

Author

Maria Antonietta Del Ferraro mariaantonietta.delferraro@yahoo.it
Henk A.L. Kiers h.a.l.kiers@rug.nl
Paolo Giordani paolo.giordani@uniroma1.it

Examples

Run this code
# vector
x <- rnorm(6)
y <- ord(x)
# matrix
X <- matrix(rnorm(6*3),ncol=3)
Y <- ord(X)

Run the code above in your browser using DataLab