UniqueSeq: Sequence within unique values

View source: R/UniqueSeq.R

UniqueSeqR Documentation

Sequence within unique values

Description

Sequence within unique values

Usage

UniqueSeq(x, sortdata = matrix(1L, length(x), 0))

Arguments

x

vector

sortdata

matrix or vector to determine sequence order

Value

integer vector

Author(s)

Øyvind Langsrud

Examples

# 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))

SSBtools documentation built on Oct. 30, 2024, 5:09 p.m.

Related to UniqueSeq in SSBtools...