Description Usage Arguments Value Author(s) Examples
Generate a permutation order statistics based on FUN
1 | bertin.order(z, MARGIN = 1, pivot = 1, FUN = cor)
|
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. |
a vector of order statitics
G. Sawitzki
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.