PRTools contents

PRTools manual

renumlab

RENUMLAB

Renumber labels

    [NLAB,LABLIST] = RENUMLAB(LABELS)
    [NLAB1,NLAB2,LABLIST] = RENUMLAB(LABELS1,LABELS2)

Input
 LABELS,LABELS1,LABELS2 Array of labels

Output
 NLAB,NLAB1,NLAB2 Vector of numeric labels
 LABLIST Unique labels

Description

If a single array of labels LABELS is supplied, it is converted and  renumbered to a vector of numeric labels NLAB. The conversion table  LABLIST is such that LABELS = LABLIST(NLAB,:). When two arrays LABELS1 and LABELS2 are given, they are combined into two numeric label vectors  NLAB1 and NLAB2 with a common conversion table LABLIST.

Note that numeric labels with value -inf or NaN and string labels CHAR(0) are interpreted as missing labels. Their entry in NLAB will be 0 and they  will not have an entry in LABLIST.

A special command is

    NLAB = RENUMLAB(LABELS,LABLIST)

which returns the indices of LABELS in a given LABLIST.

See also

dataset,

PRTools contents

PRTools manual