compact_index: Compact a vector of indices

Description Usage Arguments Details Value

View source: R/labelling.R

Description

Take a vector v of indices, then simplify the indexing system and compact it from 1 to length(unique(v)).

Usage

1

Arguments

v

a vector of integers, used as indices.

Details

The indexing vector v is simplified and compacts from 1 to length(unique(v)). The index order is not changed, only the labels are changed. The function is useful for debugging computations on values sorted by a program.

Value

Return a vector of integer, that can be browsed by the code seq_len(length(unique(v))).


functClust documentation built on Dec. 2, 2020, 5:06 p.m.