reidx.cut: re-index cut(ree) vector

Description Usage Arguments Details Value Author(s) Examples

View source: R/clusterluts.R

Description

Internal rank increasing within ties so that after reordering the order of ties can be preserved

Usage

1

Arguments

cut

cut from hierarchical clustering (through link[stats]{cutree})

Details

the output vector is named with (original level + position as decimal fraction) with ties for that level, see example. this can handles multiplicities of up to 999 which should suffice for most practical cases.

This is useful to reorder, e.g., a color LUT from color.shades according to levels.

Value

rank vector with names to indicate level and order within ties

Author(s)

Benno Pütz puetz@psych.mpg.de

Examples

1
2
3
4
5
6
7
ct <- c(4, 1, 2, 3, 1, 1, 1, 1, 4, 1, 1, 3, 1, 3)
reidx.cut(ct)
## 4.1 1.1 2.1 3.1 1.2 1.3 1.4 1.5 4.2 1.6 1.7 3.2 1.8 3.3
##  13   1   9  10   2   3   4   5  14   6   7  11   8  12
## the first occurence of level 1 is named 1001 (see details)
cs <- color.shades(table(ct))
rocs <- cs[, reidx.cut(ct)]

bennop/clusterLUTs documentation built on Nov. 21, 2020, 9:07 a.m.