Relabels a vector to consecutive labels
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)
.
relabel_vector(vec, order = FALSE)
vec |
vector with labels |
order |
logical; if |
TempVec <- c(10, 2, 1, 2, 2, 2, 10) print(relabel_vector(TempVec)) print(relabel_vector(c(2, 2, 5)))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.