A.inv(p)

Read(891) Label: adjust, order of member,

Description:

Adjust the order of members of a sequence.

Syntax:

A.inv(p)

Note:

The function adjusts the order of members of A according to the integer sequence p, whose members are ranks of members of sequence A, and return the new A.

 

If p has duplicate members or has different number of members from A, or the value of a member of p exceeds the maximum sequence number of A’s member, the function will return null. It does not handle the ties.

Parameter:

p

An integer sequence, whose members are ranks of members of A. So, the number of its members is the same as that of members of A, and it is a unique n-integer sequence (n is the length of sequence A)

A

A sequence or a record sequence

Return value:

Sequence

Example:

 

A

 

1

[b,c,a,d]

 

2

=A1.inv([2,3,1,4])

[a,b,c,d]

3

[b,a,a,c]

 

4

=A3.inv([2,1,1,3])

[a,b,c,null]

 

Related function:

p.inv(k)