partuniq: Classifies Data According to Unique Observations

Description Usage Arguments Value See Also Examples

View source: R/util.R

Description

Gives a one-to-one mapping from unique observations to rows of a data matrix.

Usage

1

Arguments

x

Matrix of observations.

Value

A vector of length nrow(x) with integer entries. An observation k is assigned an integer i whenever observation i is the first row of x that is identical to observation k (note that i <= k).

See Also

partconv

Examples

1
2
3
4
5
6
7
8
9
set.seed(0)

mat <- data.frame(lets = sample(LETTERS[1:2],9,TRUE), nums = sample(1:2,9,TRUE))
mat

ans <- partuniq(mat)
ans

partconv(ans,consec=TRUE)

Japrin/mclust documentation built on Nov. 18, 2019, 5:21 a.m.