bertin.order: Generate a permutation order

Description Usage Arguments Value Author(s) Examples

Description

Generate a permutation order statistics based on FUN

Usage

1
bertin.order(z, MARGIN = 1, pivot = 1, FUN = cor)

Arguments

z

a data matrix.

MARGIN

a vector giving the subscripts which the function will be applied over. ‘1’ indicates rows, ‘2’ indicates columns.

pivot

the reference point.

FUN

the function to be applied, typically a distance function or a similarity measure.

Value

a vector of order statitics

Author(s)

G. Sawitzki

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (z, MARGIN=1, pivot=1, FUN=cor)
{
if (MARGIN==1)
{ dist <- vector(mode="numeric", length=nrow(z) )
for (i in (1: nrow(z))){
	dist[i] <- FUN(z[pivot,],z[i,])
  }
  } else {
dist <- vector(mode="numeric", length=ncol(z) )
for (i in (1: ncol(z))){
	dist[i] <- FUN(z[,pivot],z[,i])
  }
  }
order(dist)
  }

bertin documentation built on May 2, 2019, 5:54 p.m.

Related to bertin.order in bertin...