OrderByRank - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Statistics

  

OrderByRank

  

order data items according to their ranks

 

Calling Sequence

Parameters

Description

Options

Notes

Examples

Calling Sequence

OrderByRank(X, R, options)

Parameters

X

-

data sample

R

-

ranks

options

-

(optional) equation(s) of the form option=value where option is one of order or unique; specify options for the OrderByRank function

Description

• 

The OrderByRank command orders the elements/rows of X according to their ranks.

• 

The first parameter X is the data set - given as e.g. a Vector.

• 

The second parameter R is the ranks data (also specified as a data set).

Options

  

The options argument can contain one or more of the options shown below.

• 

order = ascending or descending -- Indicate whether the elements of X should be sorted in the ascending or descending order. The default value is order=ascending.

• 

unique=truefalse -- If this option is set to true, all multiple occurrences of elements from X will be removed. The default value is unique=false.

Notes

• 

The OrderByRank command creates a copy of the original Array.

Examples

withStatistics:

AArraya,b,c,d,e,f,g,h

Aabcdefgh

(1)

BArray5,4,3,7,6,2,8,1

B54376281

(2)

OrderByRankA,B

hfcbaedg

(3)

Sort two arrays simultaneously.

AArray5.,4.,3.,7.,6.,2.,8.,1.

A5.4.3.7.6.2.8.1.

(4)

BArraya,b,c,d,e,f,g,h

Babcdefgh

(5)

CRankA

C54376281

(6)

OrderByRankA,C

1.2.3.4.5.6.7.8.

(7)

OrderByRankB,C

hfcbaedg

(8)

XArraya,b,c,d

Xabcd

(9)

YArray2,3,4,1

Y2341

(10)

OrderByRankX,Y

dabc

(11)

ZArray2,3,4,3

Z2343

(12)

OrderByRankX,Z

Error, (in Statistics:-OrderByRank) duplicate rank: 3

OrderByRankX,Z,unique=true

adc

(13)

AArray1..6,1..2,10,a,5,b,2,c,3,d,7,e,20,f

A10a5b−2c3d7e20f

(14)

RRankA1..1,1

R531246

(15)

OrderByRankA,R

−2c3d5b7e10a20f

(16)

See Also

Statistics

Statistics[Computation]

Statistics[Rank]

Statistics[Sort]