Description Usage Arguments Examples
View source: R/relabel_vector.R
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)
.
1 | relabel_vector(vec, order = FALSE)
|
vec |
vector with labels |
order |
logical; if |
1 2 3 4 | TempVec <- c(10, 2, 1, 2, 2, 2, 10)
print(relabel_vector(TempVec))
print(relabel_vector(c(2, 2, 5)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.