Learn R Programming

labeltodendro (version 1.3)

relabel: relabels a vector, insisting that the labels appear in increasing order

Description

If you need to relabel a huge matrix, use relabel.matrix.

Usage

relabel(x)

Arguments

x
a vector of integers

Details

This calls a C function, hence it is relatively fast.

See Also

relabel.matrix, selectlabels

Examples

Run this code
x<-c(2,2,2,2,1,2,2,2,2) #labels do not appear in increasing order
relabel(x) # gives the relabelled vector
          

Run the code above in your browser using DataLab