Learn R Programming

compositions (version 1.40-2)

gsi2.invperm: Internal function: Invert a permutation

Description

Finds the inverse of a permutation given as a vector of indices.

Usage

gsi2.invperm( i,n )

Arguments

i

a sequence of different integers in 1:n considered as a permutation given by p=unique(c(i,1:n))

n

the number of elements to be permuted

Value

an integer vector v describing the inverse permutation of p.

Details

The inverse permutation is defined by p[v]==1:n and v[p]==1:n.

See Also

gsi

Examples

Run this code
# NOT RUN {
#gsi2.invperm(c(2,3),10)
# }

Run the code above in your browser using DataLab