UniqueSeq | R Documentation |
Sequence within unique values
UniqueSeq(x, sortdata = matrix(1L, length(x), 0))
x |
vector |
sortdata |
matrix or vector to determine sequence order |
integer vector
Øyvind Langsrud
# 1:4 within A and 1:2 within B
UniqueSeq(c("A", "A", "B", "B", "A", "A"))
# Ordered differently
UniqueSeq(c("A", "A", "B", "B", "A", "A"), c(4, 5, 20, 10, 3, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.