Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Data Manipulation : Statistics/OrderByRank

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

A:=abcdefgh

(1)

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

B:=54376281

(2)

OrderByRankA,B

hfcbaedg

(3)

Sort two arrays simultaneously.

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

A:=5.4.3.7.6.2.8.1.

(4)

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

B:=abcdefgh

(5)

CRankA

C:=54376281

(6)

OrderByRankA,C

1.2.3.4.5.6.7.8.

(7)

OrderByRankB,C

hfcbaedg

(8)

XArraya,b,c,d

X:=abcd

(9)

YArray2,3,4,1

Y:=2341

(10)

OrderByRankX,Y

dabc

(11)

ZArray2,3,4,3

Z:=2343

(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

A:=10a5b2c3d7e20f

(14)

RRankA1..1,1

R:=531246

(15)

OrderByRankA,R

2c3d5b7e10a20f

(16)

See Also

Statistics

Statistics[Computation]

Statistics[Rank]

Statistics[Sort]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam