Learn R Programming

seriation (version 1.1-0)

get_order: Getting an Integer Permutation Vector from a Permutation Object

Description

Method to get an integer permutation vector from an object of class ser_permutation or ser_permutation_vector.

Usage

get_order(x, ...)
## S3 method for class 'ser_permutation_vector':
get_order(x, \ldots)
## S3 method for class 'ser_permutation':
get_order(x, dim = 1, \ldots)

get_rank(x, ...)

Arguments

x
an object of class ser_permutation or ser_permutation_vector.
dim
which dimension should be returned?
...
further arguments (unused).

Value

  • Returns an integer vector.

Details

get_order returns the seriation order as a permutation vector (index of 1st object, 2nd object, ... $n$th object). get_rank returns the seriation as a vector indicating the rank of the objects $1, 2, \dots, n$.

See Also

ser_permutation_vector, ser_permutation

Examples

Run this code
## permutation_vector
o <- ser_permutation_vector(sample(10))
o

get_order(o)
get_rank(o)

## permutation
o2 <- ser_permutation(o, sample(5))
o2

get_order(o2, 2)
get_rank(o2, 2)

Run the code above in your browser using DataLab