partuniq | R Documentation |
Gives a one-to-one mapping from unique observations to rows of a data matrix.
partuniq(x)
x |
Matrix of observations. |
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
).
partconv
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.