renumSeq | R Documentation |
This function renumbers a sequence, which is helpful if "gaps" appear in the sequence. For example, consider the sequence {1, 1, 3, 1, 8, 8, 8}
. This function will renumber the sequence {1, 1, 2, 1, 3, 3, 3}
. NA
s are ignored.
renumSeq(x)
x |
Numerical or character vector. |
A vector.
order
, rank
x <- c(1, 1, 3, 1, 8, 8, 8)
renumSeq(x)
y <- c(1, 1, 3, 1, 8, NA, 8, 8)
renumSeq(y)
z <- c('c', 'c', 'b', 'a', 'w', 'a')
renumSeq(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.