relabel_vector: Relabels a vector to consecutive labels
Description
This function relabels a vector to have consecutive - no
missing in between - labels. Labels always start at
\(1\) and increase by one.
For example, c(2, 2, 5) gets relabeled to
c(1, 1, 2).
Usage
relabel_vector(vec, order = FALSE)
Arguments
vec
vector with labels
order
logical; if TRUE then new state
labels are assigned by decreasing number of points in
that state. That is, state ``1'' has the most points in
the state, followed by state ``2'' etc.